axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kaloyz2 <carlo.fab...@voxsant.com>
Subject Re: Beginner Question: Error When passing composite objects with axis
Date Wed, 09 Jan 2008 05:31:26 GMT

Hello Anne,

Thank you for replying. I have been trying to generate the client stub but I
seem to be stuck with
a problem. Whenever I use the .bat file with the WSDL2Java command, it keeps
on showing the
javax.net.ssl.SSLHandshakeException. Now I know this error and have debugged
this before in
my Java code. But when it comes to the .bat file, I have followed the
document as much as I can 
but it still has the error. In Java code, I just have to set the System
properties to point properly 
to the trust store and key store objects plus their corresponding passwords
and they work properly. But in the .bat, they dont follow. Just to show,
here is the .bat file:

set wsbaseurl=https://openpbx.com:8100/sipxconfig/services/UserService
set axislib=D:\axis-bin-1_4\axis-1_4\webapps\axis\WEB-INF\lib\
set cp=%axislib%\axis.jar
set cp=%cp%;%axislib%\commons-logging-1.0.4.jar
set cp=%cp%;%axislib%\commons-discovery-0.2.jar
set cp=%cp%;%axislib%\jaxrpc.jar
set cp=%cp%;%axislib%\saaj.jar
set cp=%cp%;%axislib%\activation.jar
set cp=%cp%;%axislib%\wsdl4j-1.5.1.jar
set cp=%cp%;%axislib%\mail.jar

java -Djavax.net.ssl.keyStore=D:\location\keystore
-Djavax.net.ssl.keyStorePassword=password
java -Djavax.net.ssl.trustStore=D:\location\truststore
-Djavax.net.ssl.trustStorePassword=password
java -cp %cp% org.apache.axis.wsdl.WSDL2Java -o src -sH
%wsbaseurl%UserService?wsdl

The error:

javax.net.ssl.SSLHandshakeException:
sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.
provider.certpath.SunCertPathBuilderException: unable to find valid
certification path to requested target

Must be something wrong with the .bat? Thanks again.

Carlo Fabian


Anne Thomas Manes wrote:
> 
> You need to configure the call to use document/literal. Axis generates
> rpc/encoded by default, therefore you message is generated with an
> extra "addUser" element wrapping the request.
> 
> I suggest that you use wsdl2java to generate a client stub. The
> generated code will contain the code that generates the message and
> sets up the call object.
> 
> Anne
> 
> On Jan 8, 2008 3:01 AM, kaloyz2 <carlo.fabian@voxsant.com> wrote:
>>
>> Hello Everyone,
>>
>> I am new to using axis and everything especially calling and retrieving
>> results from the web service. I have a problem when calling a web service
>> that has other complex objects in it. This is the wsdl:
>>
>> <message name="addUserRequest">
>>     <part name="addUser" element="tns:AddUser" />
>> </message>
>>
>> Another one:
>>
>> <xsd:element name="AddUser">
>>         <xsd:complexType>
>>           <xsd:sequence>
>>             <xsd:element name="user" type="tns:User" minOccurs="1"
>> maxOccurs="1" />
>>             <xsd:element name="pin" type="xsd:string" minOccurs="1"
>> maxOccurs="1" />
>>           </xsd:sequence>
>>         </xsd:complexType>
>> </xsd:element>
>>
>> Now this is how I call the web service, I use got the jars by using the
>> stub
>> generation of java. Here is the code:
>>
>>              Service service = new Service();
>>              //Object that would make the WS call
>>              Call call = (Call)service.createCall();
>>              call.setUsername(username);
>>              call.setPassword(password);
>>              call.setTargetEndpointAddress( new
>> java.net.URL(WSAddUserAddress));
>>              QName qnAddUser=new QName(urn, "AddUser");
>>              call.setOperationName(qnAddUser);
>>              QName qnUser=new QName(urn ,"AddUser" );
>>              call.addParameter("addUser",qnUser, ParameterMode.IN);
>>
>>              //call.setReturnType(qnAddUser);
>>              call.setReturnType(org.apache.axis.Constants.XSD_STRING);
>>              User user = new User();
>>
>>
>>              AddUser addUser = new AddUser();
>>              user.setFirstName("Justice");
>>              user.setLastName("League");
>>              user.setUserName("9111111");
>>              user.setSipPassword("12345");
>>              user.setPintoken("12345");
>>              addUser.setUser(user);
>>              addUser.setPin("12345");
>>
>>              String ret = (String)call.invoke(new Object[]{addUser});
>>              String test =
>> call.getMessageContext().getRequestMessage().getSOAPPartAsString();
>>
>> But everytime this code gets executed, this is the error:
>>
>>
>> INFO [http-8080-Processor25] SipXManagerImpl.addUser(108) |
>> ...................RemoteException
>> axisFault
>> faultCode:
>> {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
>> faultSubcode:
>> faultString: org.xml.sax.SAXException: Invalid element in
>> org.sipfoundry.sipxconfig.api.AddUser - addUser
>> faultActor:
>> faultNode:
>> faultDetail:
>>        {http://xml.apache.org/axis/}hostname:openpbx4
>>
>> rg.xml.sax.SAXException: Invalid element in
>> org.sipfoundry.sipxconfig.api.AddUser - addUser
>>        at
>> org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
>>        at
>> org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
>>        at
>> org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
>>        at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown
>> Source)
>>        at
>> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
>> Source)
>>        at
>> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
>> Source)
>>        at
>> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
>> Source)
>>        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
>> Source)
>>        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
>> Source)
>>
>>
>> How someone can help. I am really stuck at this problem. Thank you to
>> everyone.
>>
>> Carlo Fabian
>> --
>> View this message in context:
>> http://www.nabble.com/Beginner-Question%3A-Error-When-passing-composite-objects-with-axis-tp14684448p14684448.html
>> Sent from the Axis - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Beginner-Question%3A-Error-When-passing-composite-objects-with-axis-tp14684448p14705485.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message