Calling remote web service

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Calling remote web service

vivtops86
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Calling remote web service

BJ Freeman
not enough information, please be more specific related to ofbiZ
Version of source code
SVN version of trunk
what you trying to accomplish in ofbiz.

Most sample code is in the beginners tutorial
https://cwiki.apache.org/OFBIZ/ofbiz-tutorial-a-beginners-development-guide.html
or in  the
framework\example
and
framework\exampleext

lastly do a google on
ofbiz web services
you will get many hits including past emails on the subject.


vivtops86 sent the following on 7/30/2010 1:52 AM:
>
> I have a web service located in a remote machine. I would like to call that
> using JAVA client.  I searched in the forum and did what they said,but
> getting an exception. Somebody please give me a sample code for accessing
> the remote web service.
> Thanks
> Vivek
Reply | Threaded
Open this post in threaded view
|

Re: Calling remote web service

vivtops86
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Calling remote web service

BJ Freeman
Hi this is outside the scope of ofbiz mailing list.
if you can show a error that is return by ofbiz then we can help.

vivtops86 sent the following on 7/30/2010 2:27 AM:

>
> My JAVA web service client is:
>
> public static Map accessService(DispatchContext dctx, Map context) {
> String endPoint = "http://10.8.5.58:8080/webtools/control/SOAPService/";
> String inputParam = "Vivek";
> Map output=null;
> Call call;
> try {
> call = (Call) new Service().createCall();
> try {
> call.setTargetEndpointAddress(new URL(endPoint));
> } catch (MalformedURLException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
> call.setOperationName(new QName("http://ofbiz.apache.org/service/",
> "learningFirstSoap"));
> call.addParameter("inputParam", org.apache.axis.Constants.SOAP_VECTOR,
> javax.xml.rpc.ParameterMode.IN);
> call.addParameter("outputParam",
> org.apache.axis.Constants.SOAP_VECTOR,
> javax.xml.rpc.ParameterMode.OUT);
> call.setReturnType(org.apache.axis.Constants.SOAP_VECTOR);
> try {
> Object responseWS=call.invoke(new Object[]{inputParam});
> } catch (RemoteException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
> output = call.getOutputParams();
> System.out.println("call invoked...");
>
>
> } catch (ServiceException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
>
> System.out.println("*******call.add parameterl********");
>
> return output;
>
> }
> I am getting "content not allowed in prolog" error at Object
> responseWS=call.invoke(new Object[]{inputParam}); statement