Help with Web Services
hi,
am trying to call a web service from a particular WSDL, i need to use JAX-WS 2.0 as part of this assignment am currently working on, but i just cannot put my head around it and where to start,,
would i need to just write a client that would call a specific method and pass the parameteres through it ?
would i need to use annotations ? as i was reading, you only use them if you expose the web service. All i was supplied with is a WSDL, and i need to design an interface using JFrame and call a specific service of my choice and receieve a response back.. and display it back.
Any helpful tips, suggestions, sample code ??
thanks
You can easily work with WSDL2Java class in axis.jar found from apache site
java -cp axis.jar:commons-logging.jar:commons-discovery.jar:wsdl4j.jar:jaxrpc.jar:saaj.jar org.apache.axis.wsdl.WSDL2Java -va "wsdl file"
This will create a stub files for the webservice, then you work with that.
Similar Messages
-
Please help with web services (JSR 172)
Hello!
I'm in need of some help. I've only worked with web services some few weeks. I have two web services that I want to access from J2ME.
Both works nice in regular Java (J2SE). I use axis so with the help of WSDL2Java I got a working client.
One of them has four operations
public boolean tryToLoginUser( String username, String password ) {}
public boolean tryToLogOffUser( String username, String password ){}
public boolean createUserAccount( String username, String password ){ }
public boolean removeUserAccount( String username, String password ){ } The problem is when I want to use Sun's Wireless Toolkit 2.2 and create stubs that way with the Stub Generator. It complains with this
warning: Operation tryToLoginUser is of the wrong encoding SOAP style/use (rpc/encoded). Document/literal only. Skipping generation of operation.
warning: Operation tryToLogOffUser is of the wrong encoding SOAP style/use (rpc/encoded). Document/literal only. Skipping generation of operation.
warning: Operation createUserAccount is of the wrong encoding SOAP style/use (rpc/encoded). Document/literal only. Skipping generation of operation.
warning: Operation removeUserAccount is of the wrong encoding SOAP style/use (rpc/encoded). Document/literal only. Skipping generation of operation.What I can tell is I need to put this in my axis deployment descriptor
<service name="UserWebService" provider="java:RPC" style="document" use="literal">instead of this:
<service name="UserWebService" provider="java:RPC">This wont work. It don't work with HTTP GET I get this error
<?xml version="1.0" encoding="UTF-8" ?>
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <soapenv:Body>
- <soapenv:Fault>
<faultcode>soapenv:Server.userException</faultcode>
<faultstring>org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.</faultstring>
- <detail>
<ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">slukare</ns1:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>I doesn�t work with WSDL2Java and when I run Sun's Wireless Toolkit 2.2 to generate stub it complains with
warning: ignoring operation "tryToLoginUser": more than one part in input message
warning: ignoring operation "tryToLogOffUser": more than one part in input message
warning: ignoring operation "createUserAccount": more than one part in input message
warning: ignoring operation "removeUserAccount": more than one part in input message
warning: Port "UserWebService" does not contain any usable operationsDoes this mean I can only use one parameter for input in an operation when I use style="document" use="literal" ??
I understood it that way, so I created a new web service that takes username and password in one String.
The new web service has four operations
public boolean tryToLoginUser( String usernameAndPassword ) {}
public boolean tryToLogOffUser( String usernameAndPassword ){}
public boolean createUserAccount( String usernameAndPassword ){ }
public boolean removeUserAccount( String usernameAndPassword ){ }The problem is that I get this error when running HTTP GET.
<?xml version="1.0" encoding="UTF-8" ?>
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <soapenv:Body>
- <soapenv:Fault>
<faultcode>soapenv:Server.userException</faultcode>
<faultstring>org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.</faultstring>
- <detail>
<ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">slukare</ns1:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>If I get a WSDL2Java client it works (!) if I manually changes the parameter names. I have four operations which all takes
String usernameAndPassword
in one String since I can only use one parameter with style="document" use="literal"
The WSDL2Java automatically set the parameter names to
usernameAndPassword
usernameAndPassword1
usernameAndPassword2
usernameAndPassword3
for the different operations. If I manually changes them to all have the name
usernameAndPassword
it works. Why doesn�t it work without manual changes? I haven�t tested the code from Sun�s Wireless Toolkit 2.2 Stub Generator yet, but that at least doesn�t give any errors .
My other web service doesn�t work either if I set style="document" use="literal".
This web service returns my own classes I have written. It works as I said previously in J2SE with WSDL2Java, but not with style="document" use="literal�. When I set this my byte[] which is returned is null when using the client from WSDL2Java, this wasn�t the case without style="document" use="literal�.
I also get an error in Sun�s Wireless Toolkit 2.2 that byte[] is not recoigniced. This wasn�t the case with axis WSDL2Java.
If I put this inside the axis deployment descriptor
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service xmlns:j2melab2="urn:businessobject.j2melab2"
name="RecipeWebService" provider="java:RPC" style="document" use="literal">
<parameter name="scope" value="session"/>
<parameter name="className" value="j2melab2.webservices.RecipeWebService"/>
<parameter name="allowedMethods" value="*"/>
<typeMapping qname="j2melab2:ArrayOfString"
type="java:java.lang.String[]"
serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding"/>
<beanMapping qname="j2melab2:Recipe" languageSpecificType="java:j2melab2.businessobject.Recipe"/>
<beanMapping qname="j2melab2:Ingredient" languageSpecificType="java:j2melab2.businessobject.Ingredient"/>
<typeMapping qname="j2melab2:ArrayofIngredient"
type="java:j2melab2.businessobject.Ingredient[]"
serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding"/>
<typeMapping qname="j2melab2:ArrayOfByte"
type="byte[]"
serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding"/>
</service>
</deployment>instead of this
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service xmlns:j2melab2="urn:businessobject.j2melab2"
name="RecipeWebService" provider="java:RPC">
<parameter name="scope" value="session"/>
<parameter name="className" value="j2melab2.webservices.RecipeWebService"/>
<parameter name="allowedMethods" value="*"/>
<typeMapping qname="j2melab2:ArrayOfString"
type="java:java.lang.String[]"
serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding"/>
<beanMapping qname="j2melab2:Recipe" languageSpecificType="java:j2melab2.businessobject.Recipe"/>
<beanMapping qname="j2melab2:Ingredient" languageSpecificType="java:j2melab2.businessobject.Ingredient"/>
<typeMapping qname="j2melab2:ArrayofIngredient"
type="java:j2melab2.businessobject.Ingredient[]"
serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding"/>
</service>
</deployment>axis WSDL2Java won�t work anymore. And Sun�s Wireless Toolkit doesn�t work either with this. How can I get this to work with Sun�s Wireless Toolkit 2.2?
So my questions are:
Do I really need style=�document� use=�literal� for J2ME?
Can I only have one parameter as input when I use style=�document� use=�literal� ?
Why do I need to manally change the parameter names?
How can I make Sun�s Wireless Toolkit 2.2 understand byte[] ?
Many thanks for help :) (I have to present a solution in 1 � week to my J2ME teacher L).hi,
i was wandering if you manage to successfully generate the stubs through the wireless toolkit at the end? i am currently having similar problem (i.e., trying to generate stub files based on wsdl from axis)? it seems that the WTK can only handle document/literal format, and so i change the wsdl to that. however, now it complains that it can't handle more than one input part in the message, (which is similar to the problem you had). so did you manage to find a solution to that, or J2ME simply does not support more than one arguement as the input?
thanks in advance,
lee -
Multiple selection in value help with Web service
Hi All,
I want to get data from web service and store in data base. I created input form with set of inputfields. For some input filds in that input form, I want to get value from web service.So I have used value help wizard. I followed below link to create value help wizard for web service.
Value help wizard working with java web service ?
While creating value help, it is only showing 'single selection' option. It does not showing any other options. Here I want to get multiple values from value help. How can I acheive this?.
Thanks,
Venkatesh RHi Venkat,
Try the below links for value help in visual composer.
Visual Composer: Value Help Data Service
Choosing Multiple Values within Visual Composer
http://help.sap.com/saphelp_nw04s/helpdata/en/50/91db4238bbf140e10000000a1550b0/frameset.htm
Regards
Basheer -
Need help with Web Services SDK.
I am new to Web Services SDK can I get documentation on same.
For documentation about the BOE XI R2 SP2 Web services go to our DevLibrary: http://devlibrary.businessobjects.com/BusinessObjectsXIR2SP2/en/devsuite.htm
then locate the Web Services topic under which, you will find the necessary info to help you deal with BOE Web Services.
Cheers
Alphonse -
Help with Web Service and Action Script
Hi! I have a Web Service to which I should pass multiple
parameters. I would like to implement it completely in Action
Script for studing. What's happening is that in the call I pass 3
parameters and the soap message created is repeating the first
parameter. Let me explain better:
Here is the declaration of the webService:
quote:
<mx:WebService
id="ws"
wsdl="
http://127.0.0.1:8080/WS1/pessoaService/pessoa.wsdl">
<mx:operation name="PesquisarPessoa">
<mx:request>
<PesquisarPessoaRequest>
<id>{fieldId0.text}</id>
<nome>{fieldNome0.text}</nome>
<endereco>{fieldEndereco0.text}</endereco>
</PesquisarPessoaRequest>
</mx:request>
</mx:operation>
</mx:WebService>
Here is my action script which invokes the PesquisarPessoa
operation:
quote:
private function exibirAlterarRegistro():void {
ws.PesquisarPessoa(fieldId0.text, fieldNome0.text,
fieldEndereco0.text);
Here is the message catched by the web service (It repeats
the first parameter):
quote:
<SOAP-ENV:Body>
<schema:PesquisarPessoaRequest xmlns:schema="
http://www.example.org/Pessoa">
<schema:id>3</schema:id>
<schema:nome>3</schema:nome>
<schema:endereco>3</schema:endereco>
</schema:PesquisarPessoaRequest>
</SOAP-ENV:Body>
Thanks!check the names of parameters published to the wsdl
file. -
Help with Web Services - AddGroup
I've been toiling with this for days and can't work out why this document doesn't create a new Group with ExternalFeed.
<PRE>
<?xml version="1.0" encoding="UTF-8"?>
<ITunesUDocument>
<Version>1.1.3</Version>
<AddGroup>
<ParentHandle>2500954087</ParentHandle>
<ParentPath></ParentPath>
<Group>
<Name>NewName</Name>
<ExternalFeed>
<OwnerEmail>xxx</OwnerEmail>
<BasicAuthUsername>itunesuprivate</BasicAuthUsername>
<URL>xxx</URL>
<BasicAuthPassword>giRU75a7GJOo3R0z</BasicAuthPassword>
<SignatureType>None</SignatureType>
<SecurityType>None</SecurityType>
<PollingInterval>Daily</PollingInterval>
</ExternalFeed>
<GroupType>Feed</GroupType>
</Group>
</AddGroup>
</ITunesUDocument>
</PRE>
(Here I've hidden valid URL and email values)
When this is submitted, the SAX parser barfs:
org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content starting with element 'URL'. The content must match '(("":URL){0-1},("":OwnerEmail){0-1},("":PollingInterval){0-1},("":SecurityType ){0-1},("":SignatureType){0-1},("":BasicAuthUsername){0-1},("":BasicAuthPassword ){0-1})'., org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content starting with element 'GroupType'. The content must match '(("":Name){0-1},("":Handle){0-1},("":GroupType){0-1},("":Explicit){0-1},("":Tr ack){0-1},("":Permission){0-UNBOUNDED},("":AllowSubscription){0-1},("":ExternalF eed){0-1})'.])
As far as I can see, everything I've got is how it should be, as specified here:
http://deimos.apple.com/rsrc/doc/iTunesUAdministratorsGuide/AboutiTunesUContent/ chapter4_section14.html
Am I missing anything?
Does the order of the elements matter? Does ExternalFeed need to be the last element in the Group?
thanks in advance for any advice!
GeorgeGeorge,
You nailed it…for your XML to be valid, it must be ordered -exactly- as the request XSD describes. An XMLSchema document can be defined in such a way that the order of elements is unimportant…however, the default behavior in XMLSchema (not just in iTunes U) is to enforce order. A correct version of your request would look like this:
<?xml version="1.0" encoding="UTF-8"?>
<ITunesUDocument>
. <Version>1.1.3</Version>
. <AddGroup>
. . <ParentHandle>2500954087</ParentHandle>
. . <ParentPath></ParentPath>
. . <Group>
. . . <Name>NewName</Name>
. . . <GroupType>Feed</GroupType>
. . . <ExternalFeed>
. . . . <URL>xxx</URL>
. . . . <OwnerEmail>xxx</OwnerEmail>
. . . . <PollingInterval>Daily</PollingInterval>
. . . . <SecurityType>None</SecurityType>
. . . . <SignatureType>None</SignatureType>
. . . . <BasicAuthUsername>itunesuprivate</BasicAuthUsername>
. . . . <BasicAuthPassword>giRU75a7GJOo3R0z</BasicAuthPassword>
. . . </ExternalFeed>
. . </Group>
. </AddGroup>
</ITunesUDocument>
Also, it's often okay to use conflicting settings…but unless you set security to "HTTP Basic Authentication", it's okay to omit BasicAuthUsername and BasicAuthPassword.
Hope this helps. -
How can I create a query with web service data control?
I need to create a query with web service data control, in WSDL, it's query operation, there is a parameter message with the possible query criteria and a return message contains the results. I googled, but cannot find anything on the query with web service. I cannot find a "Named Criteria" in web service data control like normal data control. In Shay's blog, I saw the topics on update with web service data control. How can I create a query with web service data control? Thanks.
Hi,
This might help
*054. Search form using ADF WS Data Control and Complex input types*
http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html -
Error while deploying when working with web service
Hi friends,
I am working with web service. When i try to run the build.xml, I'm receiving an error as follows:
*[javac] D:\MyWorkspace\MyProjectWeb\Javasource\aaa\bbb\ccc\ws\endpoint\ListenerServiceEndpoint.java:27: package org.springframework.ws.server.endpoint does not exist
[javac] import org.springframework.ws.server.endpoint.AbstractDomPayloadEndpoint;
[javac] ^ *
Could anyone please help me in getting this solved??
Thanks in Advance,
RobisPretty self-explanatory - the Spring framework jars are missing from the classpath used in compilation.
If you don't have them, get them from www.springframework.org. -
How to do a InsertOrUpdate with web services 2.0
I understand that InsertOrUpdate method is just valid for Web Services 1.0.
a) Is there a way to do it with web services 2.0 ? I imagine using a query and then Update or Insert.
b) if we decide to use web services 1.0 would there be any cons ? (besides a possible performance issue as in the documentation)
c) InsertOrUpdate uses the record "user key" for identification. If need to identify using another field, I suppose that the only way is thru query, etc. Any other ideas ?
Txs. for any help.
AntonioHello Antonio,
I understand that InsertOrUpdate method is just valid for Web Services 1.0.Correct, the InsertOrUpdate method is not available in WS v2.0.
a) Is there a way to do it with web services 2.0 ? I imagine using a query and then Update or Insert.That is one possibility, however it means that every insert or update would consist of two operations. I would suggest reviewing your requirements and expected use cases for a way to determine whether a record is being inserted or updated within CRMOD. The specific approach would depend on whether how the records to be entered into CRMOD are compiled (i.e. user interaction vs. batch sync component)
b) if we decide to use web services 1.0 would there be any cons ? (besides a possible performance issue as in the documentation)There are some objects that are not supported for WS v1.0 as well as the fact that field coverage is not as complete as the WS v2.0 interface.
c) InsertOrUpdate uses the record "user key" for identification. If need to identify using another field, I suppose that the only way is thru query, etc. Any other ideas ?Only certain fields or sets of fields can be used as a user key. These are described in the WS user guide. You can query on other fields to find a record in CRMOD but a unique value must be provided to identify a record for an update operation.
Thanks,
Sean -
Hello friends
I have little problem I create project with web service and now I need to add attachment to email
email I create step by step with tutorial !!!
so if anybody know HOWTO please send me any tip!!!Hello Anilkumar Vippagunta
Thank you very much for your help!!!
but I have little problem with your code
Properties properties = new Properties();
properties.put("mail.smtp.host", "comp.smtp.com");
MimeMessage msg =new MimeMessage(Session.getInstance(properties, null));
I can't define Session correctly if you can give me any tip or direction
Maybe its stupid questuion but how can I know this two properties (mail.smtp.host,comp.smtp.com)
thank you. -
Create a fragment with web service to populate the drop down list
Hello,
Can any one please advise/suggest on how to create a fragment in LiveCycle Designer ES with web service to populate the drop down list so I can re-use it for another form. I already have a drop down list to populate the data from the web serivice but need some advise on how to create a fragment for this drop down list so I can start to embed it in other forms as well.
Thanks in advance,
HDDid you follow the instructions and have a specific question? Have you also looked at the documentation http://help.adobe.com/en_US/livecycle/9.0/lcdesigner_qs_fragments.pdf
-
Search Help with Web Dynpro call on another system
Hi all,
I have to create a search help with web dynpro on a field but the database is on another system... How can I do?
Many Thanks in advance...I would use a search help exit. Nothing WDA specific here, as this has been possible long before WDA came around. With a search help exit you define the search help like normal, but instead of database table or view being the source of selection, you have a function module. Within the coding of this function module you can call an RFC to read data from another system or call a web service if you need to bridge over to something that isn't ABAP based.
You can read more about Search Help Exits here:
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/cf/21ee52446011d189700000e8322d00/frameset.htm -
Hi all,
I have to create a search help with web dynpro on a field but the database is on another system... How can I do?
Many Thanks in advance...I would use a search help exit. Nothing WDA specific here, as this has been possible long before WDA came around. With a search help exit you define the search help like normal, but instead of database table or view being the source of selection, you have a function module. Within the coding of this function module you can call an RFC to read data from another system or call a web service if you need to bridge over to something that isn't ABAP based.
You can read more about Search Help Exits here:
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/cf/21ee52446011d189700000e8322d00/frameset.htm -
Adobe forms with Web Service - nothing happens when clicking button.
Hi,
I am trying to develop adobe forms with web service. The web service
WSDL location is :- [http://www.webservicex.net/uklocation.asmx?wsdl]
I have created a new dataconnection with the above URL, drag & drop fields & button onto the form & save the form.
when I open the PDF on my local machine, enter the post code and push button, nothing happens. no error/warning message.
I also downloaded a web service example PDF from [http://partners.adobe.com/public/developer/tips/index.html]
This form also has button to execute a web service but again nothing happens?
Any clues why this is happening? I turned off my firewall thinking it might be blocking but no joy
I am using Adobe Life cycle Designer 8 & Adobe reader 8.
Thanks,
Pankaj
Edited by: PANKAJ ARORA on Jan 15, 2009 5:28 AMHi Pankaj,
While you are creating Webservice from Java file, select the Aunthenticationtype as SimpleSOAP instead of Basic SOAP (Bydefault BasicSOAP is selected, Change it to SimpleSOAP).
There are some steps after you create a Webservice.
First Download WSDL on your Local Machine from WAS.
After that when you open the zip file you get 3 WSDL's.
There we need to combine the 3 wsdl's and make it into one wsdl after you do this process.
Incorporate the WSDL in your interactive form and drag and drop the button onto the form.
Please don't try to edit any of the method because it will not work if you try to change any feature.
If you want to write Javascript for that method write it in "enter" method, script type:Javascript.
If you have any queries you can ping.
(The below link helps for you i guess)
[Interactive Forms and Web Service Integration|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/148ec26e-0c01-0010-e488-decaafae3b26] -
No result while creating a service consumer with Web Service Wizzard
Hi,
I've tried to create a service consumer with Web Service Wizzard in SE80 by using URL/HTTP Destination but nothing happens. After the popup with logondata for the WSDL I get the CRM start screen and nothing has been created in the given package.
technical details:
I use a CRM 5.0 system with SP15 (SAPKB70015).
I created the provider service at a 7.10 system with SP5 (SAPKB71005) via SPROXY, SOAMANAGER and WSPUBLISH and get the WSDL-URL from Service Registry.
The Service Registry of the 7.10 system serves as central Service Registry.
Has anybody an idea ?
ChristophGuy,
Thanks for your reply.
This problem has been solved. Since I haven't turned on everything that to use transaction SOAMANAGER needs. After complete the switch-on works, the problem never happens again.
Thanks again.
Maybe you are looking for
-
Automatic Goods Issue in Outbound delivery scenario with resp to Shipment
Hi, Could you please explain me, how Automatic Goods Issue happens in Outbound delivery scenario process and in shipment process. Is there any transaction for this? Can we use VL23 for Automatic Goods Issue in Shipment process? or is it only for Out
-
ME_PROCESS_REQ_CUST~INITIALIZE
Hello Gurus, How should I use this (INITIALIZE) method? Can this method not be used to initialize the PReq screens with default values? My requirement is that when the user calls the ME53N transaction to create a PReq, should see some field values (l
-
Safari 1.3.1 - Crash Log
Hoping someone can pinpoint the problem. TIA Date/Time: 2005-11-10 14:35:54 -0500 OS Version: 10.3.9 (Build 7W98) Report Version: 2 Command: Safari Path: /Applications/Safari.app/Contents/MacOS/Safari Version: 1.3.1 (312.3.1) PID: 562 Thread: 0 Excep
-
Hi Friends I am beginner for XI and SAP as well. i want to know that which type of adapter i have to use connect XI to SUS? thanks in advance Reguards Rohit
-
Hi, I am wondering how Nvidia Tesla Cards could be registered in a way that AE CS5 can use their GPU power. I know, by default they are not used, but Tesla Cards share the same architecture with some of the supported Cards, thus it cannot be a deepe