Problem accessing AXIS 1.4 Service
Posted: Apr 22, 2007 6:58 AM
Advertisement
Hi, I've deployed a simple web service with Axis 1.4. I've followed these steps: Create WDSDL file > Use WSDL2Java > Use AdminClient to deploy de service. But when I try to access the web service I get a Fault. The WSDL document follows: <?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://new.webservice.namespace" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ms="http://gonysan.com" targetNamespace="http://new.webservice.namespace"> <wsdl:import namespace="http://gonzalo.com" location="Calculador.xsd"/> <wsdl:types> <xs:schema targetNamespace="http://new.webservice.namespace" elementFormDefault="qualified"/> </wsdl:types> <wsdl:message name="sendMessageReq"> <wsdl:part name="message1" type="ms:reqmessage"/> </wsdl:message> <wsdl:message name="sendMessageRes"> <wsdl:part name="response" type="ms:response"/> </wsdl:message> <wsdl:portType name="Calculador"> <wsdl:operation name="sendMessage"> <wsdl:input message="tns:sendMessageReq"/> <wsdl:output message="tns:sendMessageRes"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="CalculadorBinding" type="tns:Calculador"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="sendMessage"> <wsdl:input> <soap:body use="literal"/> </wsdl:input> <wsdl:output> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="calculadorService"> <wsdl:port name="Calculador" binding="tns:CalculadorBinding"> <soap:address location="http://localhost:8080/axis/services/Calculador?wsdl"/> </wsdl:port> </wsdl:service> </wsdl:definitions> And the associated xsd file: <?xml version="1.0"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ms="http://gonysan.com" targetNamespace="http://gonysan.com"> <xsd:element name="requestmessage" type="ms:reqmessage"/> <xsd:element name="response" type="ms:response"/> <xsd:complexType name="reqmessage"> <xsd:sequence> <xsd:element name="subject" type="xsd:string"/> <xsd:element name="text" type="xsd:string"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="response"> <xsd:sequence> <xsd:element name="id" type="xsd:string"/> <xsd:element name="name" type="xsd:string"/> </xsd:sequence> </xsd:complexType> </xsd:schema> Then I try to send the next SOAP Message: POST /axis/services/Calculador HTTP/1.1 Accept: text/xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 Content-Type: text/xml; charset=utf-8 Content-Length: 642 Cache-Control: no-cache Pragma: no-cache User-Agent: Java/1.6.0_01 Host: 127.0.0.1 SAOPAcetion: "" Connection: keep-alive <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <ns1:sendMessage xmlns:ns1="http://gonzalito.com"> <ns2:Message xmlns:ns2="http://sandrita.com"> <subject>tema1</subject> <text>text1</text> </ns2:Message> <ns3:Message xmlns:ns3="http://sandgon.com"> <subject>subject2</subject> <text>text2</text> </ns3:Message> </ns1:sendMessage> </SOAP-ENV:Body></SOAP-ENV:Envelope> And I get this SOAP Error Message: HTTP/1.1 500 Error Interno del Servidor Server: Apache-Coyote/1.1 Content-Type: text/xml;charset=utf-8 Transfer-Encoding: chunked Date: Sun, 22 Apr 2007 13:55:06 GMT Connection: close 222 <?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: Invalid element in com.gonysan.Reqmessage - Message</faultstring> <detail> <ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">E0016D43884DA</ns1:hostname> </detail> </soapenv:Fault> </soapenv:Body> </soapenv:Envelope> Thanks in advance.