Menu
  • HOME
  • TAGS

Besides annotations, how do I distinguish JAX-WS from JAX-RPC?

Tag: web-services,jax-ws

Two questions

Two questions on JAX-WS and JAX-RPC

  1. Besides annotations, how do I distinguish JAX-WS from JAX-RPC?

  2. What simple POCs can I do to appreciate JAX-WS is better to use than JAX-RPC? (besides the reason that JAX-RPC is the older version). I have read all about JAX-WS and it's advantages but I find it card to figure out thinking of concrete examples or simple proof of concept that would prove that its better use it than JAX-RPC.

Can anyone help?

Best How To :

Your first question is covered by this one. To summarize, there are descriptor files present for JAX-RPC, since it uses XML mapping documents to describe reflection-based rules for marshal/unmarshal.

As for your second question, I suggest writing the same HelloService web service (provider) using both frameworks. I think you'll find JAX-WS much easier, if for no other reason than finding tutorial documentation. Use two web modules and follow tutorials to create the same functionality.

Take a look at the artifacts for both. Also experiment with adding complex Java types as input or output. Notice that JAX-RPC cannot automatically convert many WSDL/schema constructs to a Java equivalent - a great side by side comparison article (and series) is here.

A personal anecdote - due to the JAXB underpinnings, the JAX-WS service will be much more forgiving if the request message has small deviations from the WSDL such as unexpected input elements, etc. Why is this important? Versioning & maintenance. With JAX-RPC, it was much more difficult to update the service provider with new fields without breaking JAX-RPC client applications, and vice versa.

Spec Time

I've seen it mentioned that JAX-RPC is deprecated as of JavaEE 6. I don't see that wording specifically (it is listed for server implementors as "proposed optional"; the PDF spec says the following:

EE.12.2.3

JAX-WS JAX-WS, along with JAXB and the Metadata for Web Services specification, provides simpler and more complete support for web services than is available using the JAX-RPC technology. Applications that provide web services using JAX-RPC should consider migrating to the JAX-WS API.

(emphasis mine).

The JavaEE 7 spec lists JAX-RPC not only as optional (for server implementors); it also includes it in the list of "pruned Java technologies" - candidates for outright removal in subsequent JavaEE spec versions.

All this to say: you don't earn your way out of the JavaEE specification if you're the better spec.

Consuming and exposing webservices in one project (.NET)

.net,web-services,rest,soap

If you are trying to enrich the data from one source and combine that with information from another source, I think this is a decent solution. I think it is better to have one single point to talk to (your REST service), than to have two in your application and...

AFNetworking GET Parameters in body

ios,web-services,afnetworking-2

NSURLConnection which underlies AFHTTPRequestOperation does not allow a body in a GET request. In general GET does not allow a body even though curl does and it usually works on the server. If you want to send a body use a POST request....

Why do we need to publish or deploy web services or WCF?

web-services,wcf

why do we need to publish/deploy a webservices or wcf In order to make it available over internet (or) intranet (make it globally accessible). If you don't publish your service then it is not accessible by others since it can't be found/discovered. Once you publish it, then your service...

Using Java web service on Amazon cloud

java,web-services,amazon-web-services,amazon-ec2

This is pretty standard in terms of deployment. First - create a EC2 box, this will be your server, you'll need to configure the firewall to allow connections over HTTP port 8080. Second - install Tomcat on said EC2 box. Third - upload your war file to said Tomcat instance....

Can't save json data to variable (or cache) with angularjs $http.get

json,angularjs,web-services,rest

$http.get is asynchronous. When cache.get or return result are executed, HTTP request has not completed yet. How are you going to use that data? Display in UI? E.g. try the following: // Some View <div>{{myData}}</div> // Controller app.controller('MyController', function ($scope) { $http.get('yoururl').success(function (data) { $scope.myData = data; }); }); You...

The remote server returned an unexpected response: (413) Request Entity Too Large.?

c#,web-services,wcf

Try this, <bindings> <basicHttpBinding> <binding maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text"> <readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> </binding> </basicHttpBinding> </bindings> Instead of these lines in your code, <bindings> <basicHttpBinding> <binding name="SampleBinding"...

Accessing JSON elements in PHP

php,ios,json,xcode,web-services

it's because json_decode($content, true) is returning an array, which has problems displaying if you echo the container. Try doing echo $post_data['lat']; you can also try using print_r($post_data); to have it output the actual contents of the variable so you can see if something isn't working properly...

Save SOAP UI mock requests to a file

web-services,soap,request,soapui

If you want to save in a file all request that your Mock service recieve, simply do the follow. In your mock service open the onRequest script tab as in the follow image (this script executes each time that your service receives a request): And add the follow groovy script...

Server side session in asp.net

asp.net,web-services,session

You've got a quotes problem, fix it like this: <% Session["path"] = "'" + vr_ + "'"; %> EDIT 1: Javascript and ASP.NET are not the same, so you cannot access the variables, so you can't do it on the client side. You must send something to the server like...

error: cannot find symbol class AsyncCallWS Android

java,android,web-services

On the link you post, I see a class like below. Create this class in your project before using it. private class AsyncCallWS extends AsyncTask<String, Void, Void> { @Override protected Void doInBackground(String... params) { Log.i(TAG, "doInBackground"); getFahrenheit(celcius); return null; } @Override protected void onPostExecute(Void result) { Log.i(TAG, "onPostExecute"); tv.setText(fahren +...

.NET web service gets null object

c#,.net,ajax,web-services,rest

Possibly the mistake in this line var data = '{ "c:":{"Id": "1", "Name": "myname"}'; should be var data = '{ "c":{"Id": "1", "Name": "myname"}'; ...

Java-webservice: Glassfish3.0 error “org.codehaus.jackson.jaxrs.JacksonJsonProvider”

java,web-services,glassfish

I don't know your exact setup but the problem is that you are providing Jersey/Jackson 2.x libs but you are obviously using Jersey/Jackson 1.x. Note that Glassfish 3.x comes with Jersey/Jackson 1.x by default (Glassfish 4.x comes with Jersey/Jackson 2.x by default). The error message shows it can't find class...

How to make my web service url case insensitive?

web-services,wsdl,axis2

I've taken a quick look at the Axis2 code and it seems the ?wsdl extension compare is case sensitive. This thing sometimes happen. You could have a look at the code yourself and see if there is some switch somewhere to make this case insensitive (in case I missed something...

How do I include a CDATA section in a WCF client webservice call in .Net?

c#,.net,web-services,wcf,cdata

Convert the XML into a Base64 string and transmit that instead. A simple re-conversion on the receiving end will give you the proper XML string.

Spring service and Spring web app in one

spring,web-services,rest,spring-mvc,web

yes that is possible to combine with web-app for example your controller package into your restful controller also work that is possible to crud operation via restful web service....

Giving a prepared SOAP response by Java

java,xml,web-services,soap

Sure you can. Even within the same Java program. Use Java HTTP Server. few lines of code and you have functional http server.

Spring Webservices gives 406 error

java,spring,web-services,spring-mvc

You are trying to return a List of Student objects in your controller. So, create a wrapper class with JAXB annotations and use that wrapper class while returning from your controller to fix the issue. For example, create the class like this: @XmlRootElement public class WrapperList<T> { private List<T> list;...

WebMethod having array as a parameter

asp.net,web-services

string[] it's not a primitive type, as String, o a Integer are. Maybe you can try SoapUI (http://www.soapui.org). Or you can place it into a test ASPx page, as a static method, and try it so, vía JS: function test() { PageMethods.Concat(array_values,integer1,integer2); } function test_callback(result){ alert(result); } ...

Exclude Package From Gradle Dependency

java,web-services,rest,gradle

I found out that com.sun.jersey:jersey-core:1.19 doesn't bundle the javax.ws.rs class files and instead lists them as a compile-time dependency. Adding this snippet to my build.gradle fixed the issue. configurations.all { resolutionStrategy { // For a version that doesn't package javax.ws force 'com.sun.jersey:jersey-core:1.19' } } ...

How to pass HTTP request to Web-Service

ajax,web-services,liferay,liferay-6,portlet

Suggesting to rethink your problem. A servlet request object does not make any sense as parameter for a web service call. Those are two totally different frameworks. A servlet request only makes sense within the processing of a servlet and is defined within that context. You are probably interested in...

Javamail ClassCastException when sending multipart messages

java,jboss,jax-ws,javamail,classloader

There was a bug in the interaction between JavaMail and JAX-WS. The latest versions of the JDK include a fix for this bug. Upgrade to JDK 1.8, or the latest version of JDK 1.7. A workaround may be to do this after JAX-WS is initialized: MailcapCommandMap mailMap = (MailcapCommandMap) CommandMap.getDefaultCommandMap();...

Using client certificate with Apache Axis 1

web-services,tomcat,axis,client-certificates

The solutions is to use JVM-Paramters for truststore and keystore. java -Djavax.net.ssl.trustStore=/some/path/myTruststore.jks -Djavax.net.ssl.trustStorePassword=abc -Djavax.net.ssl.keyStore=/some/path/myKeystore.p12 -Djavax.net.ssl.keyStorePassword=defg -Djavax.net.ssl.keyStoreType=PKCS12 ...

JAX-RS @FormParam one time for all methods

java,web-services,java-ee,jax-rs,java-ee-6

This will filter the required parameters before processing. import javax.servlet.*; import javax.servlet.annotation.WebFilter; import java.io.IOException; @WebFilter(urlPatterns = {"/*"}, description = "Filters!") public class MyFilter implements Filter { private FilterConfig filterConfig; @Override public void init(FilterConfig filterConfig) throws ServletException { this.filterConfig = filterConfig; } @Override public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain)...

Not able to create a WCF RestFul Service's client

asp.net,web-services,wcf,rest

I found the answer myself. In my service I had not declared an endpoint for met data exchange due to which when I was trying to add the reference of the service to the client the required app.config was not being generated. Adding the end point for metadata exchange solved...

Retrofit error: Expected BEGIN_ARRAY but was STRING

android,web-services,retrofit

Did you try with the raw response type? @GET("your_url") void getDetails(Callback<Response> cb); Then you can parse the Response using JSONObject and JSONArray like this: Callback<Response> callback = new Callback<Response>() { @Override public void success(Response detailsResponse, Response response2) { String detailsString = getStringFromRetrofitResponse(detailsResponse); try { JSONObject object = new JSONObject(detailsString); //In...

SoapException: Host is not known, only when called from WebService

asp.net,web-services,azure

The error message was a bit of a red herring. Turns out the problem was that the external web service was throwing a 500. We solved that and the error disappeared.

Adding Acumatica Customer Contacts

web-services,acumatica

Hope you are using Screen ID's AR303000 and CR302000, After you add the command for action "Add Contact" in customer schema and submit You may use the screen CR302000 and set the ContactID and submit first to load all information(if exists) to the schema later you add commands for the...

Android AsyncTask with JSON Parsing error

java,android,json,web-services,wcf

It seems you havn't use your JSONArray object JSONArray mainfoodlist = null; tipshealth = json.getJSONArray(TAG_RESPONSE); // looping through All RESPONSE for (int i = 0; i < tipshealth.length(); i++) { JSONObject jsonobj = tipshealth.getJSONObject(i); tipHealth = jsonobj.getString(KEY_HEALTHTIPS); listhealthtips.add(tipshealth.getJSONObject(i).getString("tips")); } ...

Sending Image From Android to C# webservice

c#,android,web-services,encoding,android-image

I figure it out I didn't Canvas it before sending it to server. use this too Canvas canvas = new Canvas(mBitmap); v.draw(canvas); public void save(View v) { mBitmap = Bitmap.createBitmap(v.getWidth(), v.getHeight(), Bitmap.Config.RGB_565); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); mBitmap.compress(Bitmap.CompressFormat.JPEG,40, outputStream); byte[] imgByte = outputStream.toByteArray(); String base64Str = Base64.encodeToString(imgByte, Base64.DEFAULT); Canvas canvas...

Can I throw a message fault back to a WCF client from a routing service

c#,.net,web-services,wcf,encryption

Using Ricardo's information I was able to narrow down what I was doing. The actual answer to this is entirely up to the Endpoint configuration. It is dependent on your binding. We didn't have to change any thing in the router, but we had to change the client it looks...

Call php from javascript

javascript,php,html,web-services,google-maps

You're probably looking to implement AJAX. What you would do is separate the PHP code from your Javascript, and make a page that simply outputs the coordinates. You then call this page from your Javascript, and you'll get the result in a variable. The easiest (but not best as you'll...

Create Enveloped Signature with CXF and WSS4J

java,soap,cxf,jax-ws,xml-signature

As far as I understood, WSS4J is not able to create an Enveloped Signature at all! Therefore I moved into another direction. I used Apache Santuario in order to create a Signature for my message. I used the Intercepor mechanism of CXF to create my own interceptor, an abstract class...

Is communication via web services standardized among JavaScript on different browsers?

javascript,web-services

If this code works in Chrome, can I assume that it will also work in other major browsers assuming you will be creating a httpRequest object and the appropriate fallback for what ever browsers you are using, then you can presume that it will work across browsers, providing the...

Not Able to consume external RestFul web service from Client in Eclipse or from restclient-ui

java,eclipse,web-services,restful-url,rest-client

Try setting your company's proxy using: System.getProperties().put("https.proxyHost", "proxyHost"); System.getProperties().put("https.proxyPort", "proxyPort"); Similarly for http....

Continuing with Spring integration flow after SoapFault

web-services,spring-integration,soapfault

You can inject SoapFaultMessageResolver to the <int-ws:outbound-gateway> (fault-message-resolver). This one has pretty simple code: public void resolveFault(WebServiceMessage message) throws IOException { SoapMessage soapMessage = (SoapMessage) message; throw new SoapFaultClientException(soapMessage); } So, you failed WS invocation will end up with an Exception. Add <int-ws:request-handler-advice-chain> to your <int-ws:outbound-gateway> and place there...

Calling Perl script from Java (JAX-WS in Eclipse)

java,eclipse,perl,jax-ws

I got similar stuff some time ago. The solution for me was to 'accept' the output of the program. Something like this: Process p = Runtime.getRuntime().exec(cmd); final InputStream is = p.getInputStream(); new Thread(new Runnable() { @Override public void run() { try { while (is.available() != 0) { is.read(); } }...

How to consume multipart/form data request in C# mvc 4 webservice

c#,asp.net-mvc,web-services,wcf,asp.net-mvc-4

Check Request.Files variable. foreach (string file in Request.Files) { var postedFile = Request.Files[file]; postedFile.SaveAs(Server.MapPath("~/UploadedFiles") + pelicula.Id); } ...

HTTP 415 Unsupported Media Type

java,web-services,maven,jax-rs

I deleted all my dependency code in pom.xml and added following code which has jersey-core, jersey-bundle, jersey-json <dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-bundle</artifactId> <version>1.19</version> </dependency> <dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-json</artifactId> <version>1.19</version> </dependency> <dependency> <groupId>com.sun.jersey</groupId>...

Failed to load resource: the server responded with a status of 421 (Bad Request)

javascript,html,ios,web-services,cloudkit

The CloudKit.js library is a wrapper around the CloudKit Web Services, and its documentation states that an HTTP 421 happens when a request was called that required authentication, but the user was not logged in. This is expected as your app will likely need to determine if a user is...

Push notification to android from ASP.NET webservices

android,asp.net,vb.net,web-services,google-cloud-messaging

Seems as if something with the authentication did not work. According to the guide, your API key is not valid: If you receive a 401 HTTP status code, your API key is not valid See also this answer for possible causes for 401 when using GCM: http://stackoverflow.com/a/11903863. It refers to...

Responsive Websites - Is important or not for increase your business?

web-services,responsive-design

Both responsive and adaptive design attempt to optimize the user experience across different devices, adjusting for different viewport sizes, resolutions, usage contexts, control mechanisms, and so on. Responsive design works on the principle of flexibility. The idea is that a single fluid design based upon media queries, flexible grids, and...

WCF Services In Background

c#,web-services,wcf

TLDR; Here is how I do this, I have a Program class that allows me to start my application either as Windows Service (for production) or as a Console Application (for debugging and easy testing) internal class Program { private static void Main(string[] args) { var appMgr = new ApplicationManager();...

How to add object to WSDL service system.array

c#,arrays,web-services,wsdl

Why do you say the array is immutable? Does the 2nd to last line throw an error? If it is in fact immutable, you can use Array.Clone to copy the existing array and pass that. Alternatively, if the service is only expecting new/edited invoices to be passed to the SaveInvoices...

Can not send Captcha image through nusoap webservice

php,web-services,nusoap,simplecaptcha

You need to give your imagepng() function another parameter to save the picture then with Get_file_content() function get the content of your image file then encode it to base64 to send via webservice in xml format. include_once('captcha.php'); class getCaptcha extends DBM { public function getcaptcha($dump) { //creating and generating captcha...

understand spring-ws, integration with spring-mvc and automatic generation of wsdl

java,spring,web-services,wsdl,spring-ws

The problem is that your xsd is wrong. You should wrap your complex types in an element. <xs:element name="deliverShortMessageRequest"> <xs:complexType> <xs:sequence> <xs:element name="parameters" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element name="sms" type="tns:deliverShortMessage"/> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element /> <xs:element name="deliverShortMessageResponse">...

How to do authentication using SOAP Header and PHP?

php,web-services,soap,wsdl

I found the solution. You should declare the function APIValidate in the binding in the file wsdl. <operation name='APIValidate'> <soap:operation soapAction='urn:PortfolioLookup#APIValidate'/> <input> <soap:body use='encoded' namespace='urn:PortfolioLookup' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> </input> <output> <soap:body use='encoded' namespace='urn:PortfolioLookup' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/> </output> </operation> And...

Is JSON better than XML? Which one is more secured? [duplicate]

android,json,xml,web-services,rest

In compare to JSON and XML , there is no difference in security but JSON is much faster than XML thats why we prefer JSOn over XMl...But if you see from security point of view than you can go for SOAP

Error deploying yii2-starter-kit Yii2 installation

web-services,yii2

The Yii2-Starter-Kit is not ready to work in a single-domain installation. You must enable, for example: backend.website.com, storage.website.com and the frontpage www.website.com The installation guide, specifies this. You can use this guide, to setup your single-domain installation (remember that the yii2-starter-kit also uses the storage folder!). Have a great week....

How to deal with extra “/” in phpleague route?

php,web-services,routing

There are two options You can use htaccess to strip the trailing slash from the url. Send the dispatcher the url without the trailing slash. Solution 1: htaccess Add the following rewrite rule to your .htacces: RewriteRule ^(.*)/$ /$1 [L,R=301] Solution 2: dispatcher After you've created the router from a...

Not able to hit 2nd services with generated Token

c#,web-services,rest,soap,drupal-services

Finally i figured out what was the issue i was creating new cookie container for both the request request.CookieContainer = new CookieContainer(); thus server was unable to authenticate Error was resolved by using this code CookieContainer cookieJar = new CookieContainer(); private void CreateObject() { try { string abc = "";...