I'm getting below error while fetching a response from SOAP service from a java client:
[javax.xml.bind.UnmarshalException: unexpected element (uri:"http://www.carefirst.com/Enterprise/DAC/AddressRetrievalSchema", local:"AddressInfoResponse"). Expected elements are (none)]
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(UnmarshallerImpl.java:447)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:372)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:342)
But I was able to successfully connect to the service from Eclipse but when deployed the jar to my webshere server i am getting this error.
There are no service end, it was able to successfully send the below response:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:AddressInfoOut xmlns:ns0="http://www.carefirst.com/Enterprise/DAC/DACStatusService">
<Output>
<ns1:AddressInfoResponse xmlns:ns1="http://www.carefirst.com/Enterprise/DAC/AddressRetrievalSchema">
<ns1:Success>true</ns1:Success>
<ns1:docProp>
<ns1:Property PropertyName="BTCH_ID">222EOB222</ns1:Property>
<ns1:Property PropertyName="outbound address line1">103 North Washington Street</ns1:Property>
<ns1:Property PropertyName="outbound address city">Suitland</ns1:Property>
<ns1:Property PropertyName="mail forwarding address line1">103 N WASHINGTON ST</ns1:Property>
<ns1:Property PropertyName="mail forwarding address city">BRYANS ROAD</ns1:Property>
<ns1:Property PropertyName="fiserv status">mailed</ns1:Property>
</ns1:docProp>
</ns1:AddressInfoResponse>
</Output>
</ns0:AddressInfoOut>
WSDL
<?xml version="1.0" encoding="UTF-8"?>
<!--Created by TIBCO WSDL-->
<wsdl:definitions xmlns:ns2="http://www.carefirst.com/Enterprise/DAC/AddressRetrievalSchema" xmlns:ns1="http://carefirst.com/Enterprise/Operations/SoapFault" xmlns:tns="http://www.carefirst.com/Enterprise/DAC/DACStatusService" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns0="http://www.carefirst.com/Enterprise/DAC/StatusRetrievalSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" name="Untitled" targetNamespace="http://www.carefirst.com/Enterprise/DAC/DACStatusService">
<wsdl:types>
<xs:schema xmlns="http://www.carefirst.com/Enterprise/DAC/AddressRetrievalSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.carefirst.com/Enterprise/DAC/AddressRetrievalSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xs:element name="AddressInfoRequest">
<xs:complexType>
<xs:sequence>
<xs:element ref="ns2:header" minOccurs="0"/>
<xs:element ref="ns2:body"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="AddressInfoResponse">
<xs:complexType>
<xs:sequence>
<xs:element ref="ns2:Success"/>
<xs:element ref="ns2:docProp"/>
<xs:element ref="ns2:Error" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="BatchID" type="xs:string"/>
<xs:element name="Error">
<xs:complexType>
<xs:sequence>
<xs:element ref="ns2:msgCode" minOccurs="0"/>
<xs:element ref="ns2:msg" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Success" type="xs:boolean"/>
<xs:element name="TransactionID" type="xs:string"/>
<xs:element name="body">
<xs:complexType>
<xs:sequence>
<xs:element ref="ns2:BatchID"/>
<xs:element ref="ns2:TransactionID"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="docProp">
<xs:complexType>
<xs:sequence>
<xs:element name="Property" maxOccurs="unbounded">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="PropertyName" type="xs:string"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="header" type="xs:string"/>
<xs:element name="msg" type="xs:string"/>
<xs:element name="msgCode" type="xs:string"/>
</xs:schema>
<xsd:schema xmlns="http://carefirst.com/Enterprise/Operations/SoapFault" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://carefirst.com/Enterprise/Operations/SoapFault" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:element name="fault">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="faultType" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="SystemUnavailableFault" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="msg" type="xsd:string" minOccurs="0"/>
<xsd:element name="msgCode" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="SourceSystemInvalid" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="msg" type="xsd:string" minOccurs="0"/>
<xsd:element name="msgCode" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="DataNotFound" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="msg" type="xsd:string" minOccurs="0"/>
<xsd:element name="msgCode" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="ApplicationException" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="msg" type="xsd:string" minOccurs="0"/>
<xsd:element name="msgCode" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="SystemTimeOutException" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="msg" type="xsd:string" minOccurs="0"/>
<xsd:element name="msgCode" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="PackageNotCompiled" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="msg" type="xsd:string" minOccurs="0"/>
<xsd:element name="msgCode" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="AuthenticationException" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="msg" type="xsd:string" minOccurs="0"/>
<xsd:element name="msgCode" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="InputDataInvalid" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="msg" type="xsd:string" minOccurs="0"/>
<xsd:element name="msgCode" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="DefaultFault" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="faultCode" type="xsd:string" minOccurs="0"/>
<xsd:element name="faultMsg" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<xs:schema xmlns="http://www.carefirst.com/Enterprise/DAC/StatusRetrievalSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.carefirst.com/Enterprise/DAC/StatusRetrievalSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xs:element name="BatchID" type="xs:string"/>
<xs:element name="CDWBatchID" type="xs:string"/>
<xs:element name="Error">
<xs:complexType>
<xs:sequence>
<xs:element ref="ns0:msgCode" minOccurs="0"/>
<xs:element ref="ns0:msg" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="StatusRequest">
<xs:complexType>
<xs:sequence>
<xs:element ref="ns0:header" minOccurs="0"/>
<xs:element ref="ns0:body"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="StatusResponse">
<xs:complexType>
<xs:sequence>
<xs:element ref="ns0:Success"/>
<xs:element ref="ns0:docProp"/>
<xs:element ref="ns0:Error" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Success" type="xs:boolean"/>
<xs:element name="TransactionID" type="xs:string"/>
<xs:element name="body">
<xs:complexType>
<xs:sequence>
<xs:element ref="ns0:BatchID" minOccurs="0"/>
<xs:element ref="ns0:CDWBatchID" minOccurs="0"/>
<xs:element ref="ns0:TransactionID" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="docProp">
<xs:complexType>
<xs:sequence>
<xs:element name="Property" maxOccurs="unbounded">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="PropertyName" type="xs:string"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="header">
<xs:complexType>
<xs:sequence>
<xs:element ref="ns0:senderID" minOccurs="0"/>
<xs:element ref="ns0:senderApp" minOccurs="0"/>
<xs:element ref="ns0:msgID" minOccurs="0"/>
<xs:element ref="ns0:msgVersion" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="msg" type="xs:string"/>
<xs:element name="msgCode" type="xs:string"/>
<xs:element name="msgID" type="xs:string"/>
<xs:element name="msgVersion" type="xs:string"/>
<xs:element name="senderApp" type="xs:string"/>
<xs:element name="senderID" type="xs:string"/>
</xs:schema>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.w3.org/XML/1998/namespace" elementFormDefault="unqualified" attributeFormDefault="qualified">
<attribute name="base" type="anyURI"/>
<attribute name="id" type="ID"/>
<attribute name="lang">
<simpleType>
<union memberTypes="language">
<simpleType>
<restriction base="string">
<length value="0"/>
</restriction>
</simpleType>
</union>
</simpleType>
</attribute>
<attribute name="space" default="preserve">
<simpleType>
<restriction base="NCName">
<enumeration value="default"/>
<enumeration value="preserve"/>
</restriction>
</simpleType>
</attribute>
<attributeGroup name="specialAttrs">
<attribute ref="xml:base"/>
<attribute ref="xml:id"/>
<attribute ref="xml:lang"/>
<attribute ref="xml:space" default="preserve"/>
</attributeGroup>
</schema>
</wsdl:types>
<wsdl:service name="DACStatusService">
<wsdl:port name="StatusandAddressRetrievalPortEndpoint1" binding="tns:StatusandAddressRetrievalPortEndpoint1Binding">
<soap:address location="http://localhost:9318/DACStatus_Services/BusinessProcesses/StatusandAddressRetrievalService/DACStatusService.serviceagent/StatusandAddressRetrievalPortEndpoint"/>
</wsdl:port>
</wsdl:service>
<wsdl:portType name="StatusandAddressRetrievalPort">
<wsdl:operation name="StatusRetrieval">
<wsdl:input message="tns:StatusIn"/>
<wsdl:output message="tns:StatusOut"/>
<wsdl:fault name="fault1" message="tns:Fault"/>
</wsdl:operation>
<wsdl:operation name="AddressRetrieval">
<wsdl:input message="tns:AddressInfoIn"/>
<wsdl:output message="tns:AddressInfoOut"/>
<wsdl:fault name="fault1" message="tns:Fault"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="StatusandAddressRetrievalPortEndpoint1Binding" type="tns:StatusandAddressRetrievalPort">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="StatusRetrieval">
<soap:operation style="document" soapAction="/DACStatus_Services/BusinessProcesses/StatusandAddressRetrievalService/DACStatusService.serviceagent/StatusandAddressRetrievalPortEndpoint/StatusRetrieval"/>
<wsdl:input>
<soap:body use="literal" parts="Input"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal" parts="Output"/>
</wsdl:output>
<wsdl:fault name="fault1">
<soap:fault use="literal" name="fault1"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="AddressRetrieval">
<soap:operation style="document" soapAction="/DACStatus_Services/BusinessProcesses/StatusandAddressRetrievalService/DACStatusService.serviceagent/StatusandAddressRetrievalPortEndpoint/AddressRetrieval"/>
<wsdl:input>
<soap:body use="literal" parts="Input"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal" parts="Output"/>
</wsdl:output>
<wsdl:fault name="fault1">
<soap:fault use="literal" name="fault1"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:message name="StatusIn">
<wsdl:part name="Input" element="ns0:StatusRequest"/>
</wsdl:message>
<wsdl:message name="StatusOut">
<wsdl:part name="Output" element="ns0:StatusResponse"/>
</wsdl:message>
<wsdl:message name="Fault">
<wsdl:part name="Fault" element="ns1:fault"/>
</wsdl:message>
<wsdl:message name="AddressInfoIn">
<wsdl:part name="Input" element="ns2:AddressInfoRequest"/>
</wsdl:message>
<wsdl:message name="AddressInfoOut">
<wsdl:part name="Output" element="ns2:AddressInfoResponse"/>
</wsdl:message>
</wsdl:definitions>
Could anyone please help me this
The namespace of AddressInfoResponse in the shared response is according to WSDL but the unmarshaller is not expecting AddressInfoResponse element to be in namespace http://www.carefirst.com/Enterprise/DAC/AddressRetrievalSchema.
It means the namespace is incorrect or empty in the java object against which the unmarshaller is trying to unmarshal. Please check the namespace against AddressInfoResponse object in your soap client. You need to check package-info class if you have auto generated the objects. In case you have created the client manually using SAAJ then you probably have missed the namespace for this element.
Related
Following code for calling SOAP webservice
String serviceURL="http://cbswebpr.ptcl.net.pk/QueryBillInfoServices?wsdl";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new URL(serviceURL));
call.setPortTypeName(new QName("http://ocs.ztesoft.com/xsd","QueryBillInfoServices"));
call.setOperationName(new QName("http://ocs.ztesoft.com/xsd", "queryBillInfo"));
call.setUsername("abc");
call.setPassword("1234");
call.addParameter("computerId", org.apache.axis.Constants.SOAP_STRING,ParameterMode.IN);
call.addParameter("number", org.apache.axis.Constants.SOAP_STRING ,ParameterMode.IN);
call.addParameter("packetType",org.apache.axis.Constants.SOAP_STRING ,ParameterMode.IN);
String computerId="192.168.1.1";
String number="0931231313";
String packetType="R9";
String returnValue = (String) call.invoke(new Object[] {computerId,number,packetType});
Getting following error
xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><soapenv:Fault><faultcode xmlns:nsIDc08="http://schemas.xmlsoap.org/soap/envelope/">nsIDc08:Client</faultcode><faultstring>Fail to find service because request URI is not start with service path [/services/].</faultstring></soapenv:Fault></soapenv:Body></soapenv:Envelope>
{http://xml.apache.org/axis/}HttpErrorCode:400
WSDL
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://ocs.ztesoft.com/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" name="QueryBillInfoServices" targetNamespace="http://ocs.ztesoft.com/xsd">
<wsdl:types>
<xs:schema xmlns:tns="http://ocs.ztesoft.com/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://ocs.ztesoft.com/xsd">
<xs:element name="queryBillInfo" type="tns:queryBillInfo"/>
<xs:element name="queryBillInfoResponse" type="tns:queryBillInfoResponse"/>
<xs:complexType name="queryBillInfo">
<xs:sequence>
<xs:element minOccurs="0" name="QueryBillInfoReq" type="tns:queryBillInfoReq"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="queryBillInfoReq">
<xs:sequence>
<xs:element minOccurs="0" name="addCode" type="xs:string"/>
<xs:element minOccurs="0" name="bankCode" type="xs:string"/>
<xs:element minOccurs="0" name="beginNum" type="xs:string"/>
<xs:element minOccurs="0" name="computerId" type="xs:string"/>
<xs:element minOccurs="0" name="contactNumber" type="xs:string"/>
<xs:element minOccurs="0" name="endNum" type="xs:string"/>
<xs:element minOccurs="0" name="esnNumber" type="xs:string"/>
<xs:element minOccurs="0" name="invoiceNbr" type="xs:string"/>
<xs:element minOccurs="0" name="invoiceTag" type="xs:string"/>
<xs:element minOccurs="0" name="locationId" type="xs:string"/>
<xs:element minOccurs="0" name="mdn" type="xs:string"/>
<xs:element minOccurs="0" name="number" type="xs:string"/>
<xs:element minOccurs="0" name="packetType" type="xs:string"/>
<xs:element minOccurs="0" name="queryType" type="xs:string"/>
<xs:element minOccurs="0" name="transNumber" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="header">
<xs:sequence>
<xs:element minOccurs="0" name="passWord" type="xs:string"/>
<xs:element minOccurs="0" name="userName" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="queryBillInfoResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="tns:queryBillInfoResp"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="queryBillInfoResp">
<xs:sequence>
<xs:element minOccurs="0" name="accNbr" type="xs:string"/>
<xs:element minOccurs="0" name="acctId" type="xs:string"/>
<xs:element minOccurs="0" name="address" type="xs:string"/>
<xs:element minOccurs="0" name="areaCode" type="xs:string"/>
<xs:element minOccurs="0" name="balance" type="xs:string"/>
<xs:element minOccurs="0" name="billNbr" type="xs:string"/>
<xs:element minOccurs="0" name="billState" type="xs:string"/>
<xs:element minOccurs="0" name="chargingTime" type="xs:string"/>
<xs:element minOccurs="0" name="custId" type="xs:string"/>
<xs:element minOccurs="0" name="customerName" type="xs:string"/>
<xs:element minOccurs="0" name="dueDate" type="xs:string"/>
<xs:element minOccurs="0" name="esn" type="xs:string"/>
<xs:element minOccurs="0" name="installationDate" type="xs:string"/>
<xs:element minOccurs="0" name="invoiceNbr" type="xs:string"/>
<xs:element minOccurs="0" name="latnId" type="xs:string"/>
<xs:element minOccurs="0" name="mdn" type="xs:string"/>
<xs:element minOccurs="0" name="mdnLocked" type="xs:string"/>
<xs:element minOccurs="0" name="mdnLockedCode" type="xs:string"/>
<xs:element minOccurs="0" name="mdnState" type="xs:string"/>
<xs:element minOccurs="0" name="mdnStateCode" type="xs:string"/>
<xs:element minOccurs="0" name="mdnSubscriberType" type="xs:string"/>
<xs:element minOccurs="0" name="mobile" type="xs:string"/>
<xs:element minOccurs="0" name="mobileNo" type="xs:string"/>
<xs:element minOccurs="0" name="payAfterDueDate" type="xs:string"/>
<xs:element minOccurs="0" name="payByDueDate" type="xs:string"/>
<xs:element minOccurs="0" name="resultCode" type="xs:string"/>
<xs:element minOccurs="0" name="resultMsg" type="xs:string"/>
<xs:element minOccurs="0" name="transNumber" type="xs:string"/>
<xs:element minOccurs="0" name="validForPayment" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="AuthHeader" nillable="true" type="tns:header"/>
</xs:schema>
</wsdl:types>
<wsdl:message name="queryBillInfoResponse">
<wsdl:part name="parameters" element="tns:queryBillInfoResponse"> </wsdl:part>
</wsdl:message>
<wsdl:message name="queryBillInfo">
<wsdl:part name="parameters" element="tns:queryBillInfo"> </wsdl:part>
<wsdl:part name="AuthHeader" element="tns:AuthHeader"> </wsdl:part>
</wsdl:message>
<wsdl:portType name="QueryBillInfoServices">
<wsdl:operation name="queryBillInfo">
<wsdl:input name="queryBillInfo" message="tns:queryBillInfo"> </wsdl:input>
<wsdl:output name="queryBillInfoResponse" message="tns:queryBillInfoResponse"> </wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="QueryBillInfoServicesSoapBinding" type="tns:QueryBillInfoServices">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="queryBillInfo">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="queryBillInfo">
<soap:header message="tns:queryBillInfo" part="AuthHeader" use="literal"> </soap:header>
<soap:body parts="parameters" use="literal"/>
</wsdl:input>
<wsdl:output name="queryBillInfoResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="QueryBillInfoServices">
<wsdl:port name="QueryBillInfoServicesPort" binding="tns:QueryBillInfoServicesSoapBinding">
<soap:address location="http://cbswebpr.ptcl.net.pk:8180/services/QueryBillInfoServices/"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
I am trying to transform data from xml to json format, For that I have written xsd schema from the xml output to transform data from xml to json.
Following is my xml which needs to be transformed to json
<?xml version="1.0" encoding="UTF-8"?>
<SyncData>
<Employerid>12345</Employerid>
<ImporterEmail>abcdef#xyz.com</ImporterEmail>
<ReportEmail>abcdefggggg#xyz.com</ReportEmail>
<Employees>
<wd:WorkerSummary xmlns:is="java:com.workday.esb.intsys.xpath.
ParsedIntegrationSystemFunctions"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xdiff="urn:com.workday/esb/xdiff" xmlns:wd="urn:com.workday/bsvc">
<wd:ReferenceID/>
<wd:Name>abcdef,ghijklm</wd:Name>
<wd:Title/>
<wd:EmployeeId>JG00889</wd:EmployeeId>
<wd:EMail>sderf.rtyui#xyzz.com</wd:EMail>
<wd:AddressLine1>1400 Post Alm Tyui</wd:AddressLine1>
<wd:City>Bostonn</wd:City>
<wd:State>MC</wd:State>
<wd:Zip>11067</wd:Zip>
<wd:Country>AUS</wd:Country>
</wd:WorkerSummary>
</Employees>
</SyncData>
Following are the two different xsd schema’s that I have defined from the above stated xml and I am getting different error’s for each one.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.your-company.com/WorkermapSchema"
xmlns:tns="http://www.your-company.com/WorkermapSchema"
elementFormDefault="qualified">
<xs:element name="WorkerSummary">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="ReferenceID" />
<xs:element type="xs:string" name="Name" />
<xs:element type="xs:string" name="Title" />
<xs:element type="xs:string" name="EmployeeId" />
<xs:element type="xs:string" name="EMail" />
<xs:element type="xs:string" name="AddressLine1" />
<xs:element type="xs:string" name="City" />
<xs:element type="xs:string" name="State" />
<xs:element type="xs:string" name="Zip" />
<xs:element type="xs:string" name="Country" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
The error I was getting with this schema is as following
com.workday.esb.xmltojson.XmlToJsonException: Root Element type not found "SyncData"
Since the above error says the Root Element “SyncData” not found, I have tried to define schema in other way with the Root Element as following.
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="NewDataSet" xmlns=""
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-
microsoft-com:xml-msdata" xmlns:app1="urn:com.workday/bsvc">
<xs:import namespace="urn:com.workday/bsvc"></xs:import>
<xs:element name="SyncData">
<xs:complexType>
<xs:sequence>
<xs:element name="Employerid" type="xs:string" minOccurs="0" />
<xs:element name="ImporterEmail" type="xs:string" minOccurs="0" />
<xs:element name="ReportEmail" type="xs:string" minOccurs="0" />
<xs:element name="Employees" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="WorkerSummary" type="xs:string"/>
<xs:element name="ReferenceID" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="NewDataSet" msdata:IsDataSet="true"
msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="SyncData" />
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
After using the above xsd schema, I am not getting error related to Root Element “SyncData”, But I am getting a different error which I am not understanding what it is about, The error is as following.
org.codehaus.stax2.typed.TypedXMLStreamException: ParseError at [row,col]:[2,359] Message: Element content can not contain child START_ELEMENT when using Typed Access methods
Is there anything wrong in the schema or what is the error is about?
I have tried multiple attempts on xsd schema to execute it perfectly as required, but seems something is missing which I am not sure that is causing the failure.
Can you use this schema
<?xml version="1.0" encoding="utf-16"?>
<xsd:schema attributeFormDefault="unqualified" elementFormDefault="qualified" version="1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="SyncData">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Employerid" type="xsd:int" />
<xsd:element name="ImporterEmail" type="xsd:string" />
<xsd:element name="ReportEmail" type="xsd:string" />
<xsd:element name="Employees">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="wd:WorkerSummary">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="wd:ReferenceID" type="xsd:string" />
<xsd:element name="wd:Name" type="xsd:string" />
<xsd:element name="wd:Title" type="xsd:string" />
<xsd:element name="wd:EmployeeId" type="xsd:string" />
<xsd:element name="wd:EMail" type="xsd:string" />
<xsd:element name="wd:AddressLine1" type="xsd:string" />
<xsd:element name="wd:City" type="xsd:string" />
<xsd:element name="wd:State" type="xsd:string" />
<xsd:element name="wd:Zip" type="xsd:int" />
<xsd:element name="wd:Country" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
I'm trying to consume a soap web service with java.
I have classes generated by "wsimport" the following WSDL:
<?xml version='1.0' encoding='UTF-8'?><wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="RepositorioXDS" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" name="adocumentrepository_servicesService" targetNamespace="RepositorioXDS">
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0" xmlns:ns1="RepositorioXDS" targetNamespace="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0" version="1.0">
<xs:import namespace="RepositorioXDS"/>
<xs:element name="RegistryErrorList" type="tns:RegistryErrorList"/>
<xs:complexType final="extension restriction" name="RegistryErrorList">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" ref="ns1:RegistryError"/>
</xs:sequence>
<xs:attribute name="highestSeverity" type="xs:string"/>
</xs:complexType>
<xs:complexType final="extension restriction" name="RegistryError">
<xs:sequence/>
<xs:attribute name="codeContext" type="xs:string"/>
<xs:attribute name="errorCode" type="xs:string"/>
<xs:attribute name="location" type="xs:string"/>
<xs:attribute name="severity" type="xs:string"/>
</xs:complexType>
</xs:schema>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0" xmlns:ns1="RepositorioXDS" targetNamespace="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0" version="1.0">
<xs:import namespace="RepositorioXDS"/>
<xs:complexType final="extension restriction" name="AssociationType1">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="Slot" type="tns:SlotType1"/>
</xs:sequence>
<xs:attribute name="associationType" type="xs:string"/>
<xs:attribute name="home" type="xs:string"/>
<xs:attribute name="id" type="xs:string"/>
<xs:attribute name="lid" type="xs:string"/>
<xs:attribute name="objectType" type="xs:string"/>
<xs:attribute name="sourceObject" type="xs:string"/>
<xs:attribute name="status" type="xs:string"/>
<xs:attribute name="targetObject" type="xs:string"/>
</xs:complexType>
<xs:complexType final="extension restriction" name="SlotType1">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="Value" type="xs:string"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="slotType" type="xs:string"/>
</xs:complexType>
<xs:complexType final="extension restriction" name="ClassificationType">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="Name" type="tns:LocalizedStringType"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="Slot" type="tns:SlotType1"/>
</xs:sequence>
<xs:attribute name="classificationNode" type="xs:string"/>
<xs:attribute name="classificationScheme" type="xs:string"/>
<xs:attribute name="classifiedObject" type="xs:string"/>
<xs:attribute name="home" type="xs:string"/>
<xs:attribute name="id" type="xs:string"/>
<xs:attribute name="lid" type="xs:string"/>
<xs:attribute name="nodeRepresentation" type="xs:string"/>
<xs:attribute name="objectType" type="xs:string"/>
<xs:attribute name="status" type="xs:string"/>
</xs:complexType>
<xs:complexType final="extension restriction" name="LocalizedStringType">
<xs:sequence/>
<xs:attribute name="charset" type="xs:string"/>
<xs:attribute name="lang" type="xs:string"/>
<xs:attribute name="value" type="xs:string"/>
</xs:complexType>
<xs:complexType final="extension restriction" name="ExternalIdentifierType">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="Name" type="tns:LocalizedStringType"/>
</xs:sequence>
<xs:attribute name="home" type="xs:string"/>
<xs:attribute name="id" type="xs:string"/>
<xs:attribute name="identificationScheme" type="xs:string"/>
<xs:attribute name="lid" type="xs:string"/>
<xs:attribute name="objectType" type="xs:string"/>
<xs:attribute name="registryObject" type="xs:string"/>
<xs:attribute name="status" type="xs:string"/>
<xs:attribute name="value" type="xs:string"/>
</xs:complexType>
</xs:schema>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:ihe:iti:xds-b:2007" version="1.0">
<xs:complexType final="extension restriction" name="RetrieveDocumentSetRequestType.DocumentRequest">
<xs:sequence>
<xs:element form="qualified" minOccurs="0" name="DocumentUniqueId" type="xs:string"/>
<xs:element form="qualified" minOccurs="0" name="HomeCommunityId" type="xs:string"/>
<xs:element form="qualified" minOccurs="0" name="RepositoryUniqueId" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType final="extension restriction" name="RetrieveDocumentSetResponseType.DocumentResponse">
<xs:sequence>
<xs:element form="qualified" minOccurs="0" name="Document" type="xs:string"/>
<xs:element form="qualified" minOccurs="0" name="DocumentUniqueId" type="xs:string"/>
<xs:element form="qualified" minOccurs="0" name="HomeCommunityId" type="xs:string"/>
<xs:element form="qualified" minOccurs="0" name="mimeType" type="xs:string"/>
<xs:element form="qualified" minOccurs="0" name="RepositoryUniqueId" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="RepositorioXDS" xmlns:ns3="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0" xmlns:ns2="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0" xmlns:ns1="urn:ihe:iti:xds-b:2007" elementFormDefault="unqualified" targetNamespace="RepositorioXDS" version="1.0">
<xs:import namespace="urn:ihe:iti:xds-b:2007"/>
<xs:import namespace="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0"/>
<xs:import namespace="urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0"/>
<xs:element name="AssociationType1" type="ns2:AssociationType1"/>
<xs:element name="ClassificationType" type="ns2:ClassificationType"/>
<xs:element name="DocumentType" type="tns:DocumentType"/>
<xs:element name="DocumentsRequest" type="tns:DocumentsRequest"/>
<xs:element name="ExternalIdentifierType" type="ns2:ExternalIdentifierType"/>
<xs:element name="ExtrinsicObjectType" type="tns:ExtrinsicObjectType"/>
<xs:element name="LocalizedStringType" type="ns2:LocalizedStringType"/>
<xs:element name="PING" type="tns:PING"/>
<xs:element name="PINGResponse" type="tns:PINGResponse"/>
<xs:element name="PROVIDEANDREGISTERDOCUMENTSET" type="tns:PROVIDEANDREGISTERDOCUMENTSET"/>
<xs:element name="PROVIDEANDREGISTERDOCUMENTSETResponse" type="tns:PROVIDEANDREGISTERDOCUMENTSETResponse"/>
<xs:element name="RETRIEVEDOCUMENTSET" type="tns:RETRIEVEDOCUMENTSET"/>
<xs:element name="RETRIEVEDOCUMENTSETResponse" type="tns:RETRIEVEDOCUMENTSETResponse"/>
<xs:element name="RegistryError" type="ns3:RegistryError"/>
<xs:element name="RegistryErrorList" type="ns3:RegistryErrorList"/>
<xs:element name="RegistryPackageType" type="tns:RegistryPackageType"/>
<xs:element name="RegistryResponseType" type="tns:RegistryResponseType"/>
<xs:element name="RetrieveDocumentSetRequestType.DocumentRequest" type="ns1:RetrieveDocumentSetRequestType.DocumentRequest"/>
<xs:element name="RetrieveDocumentSetResponseType.DocumentResponse" type="ns1:RetrieveDocumentSetResponseType.DocumentResponse"/>
<xs:element name="SlotType1" type="ns2:SlotType1"/>
<xs:element name="SubmitObjectsRequest" type="tns:SubmitObjectsRequest"/>
<xs:element name="SubmitObjectsRequest.RegistryObjectList" type="tns:SubmitObjectsRequest.RegistryObjectList"/>
<xs:complexType name="RETRIEVEDOCUMENTSET">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="Retrievedocumentsetrequest" type="ns1:RetrieveDocumentSetRequestType.DocumentRequest"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="RETRIEVEDOCUMENTSETResponse">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="Retrievedocumentsetresponse" type="ns1:RetrieveDocumentSetResponseType.DocumentResponse"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="PROVIDEANDREGISTERDOCUMENTSET">
<xs:sequence>
<xs:element minOccurs="0" name="Submitobjectsrequest" type="tns:SubmitObjectsRequest"/>
<xs:element minOccurs="0" name="Documentsrequest" type="tns:DocumentsRequest"/>
</xs:sequence>
</xs:complexType>
<xs:complexType final="extension restriction" name="SubmitObjectsRequest">
<xs:sequence>
<xs:element minOccurs="0" name="RegistryObjectList" type="tns:SubmitObjectsRequest.RegistryObjectList"/>
</xs:sequence>
<xs:attribute name="comment" type="xs:string"/>
<xs:attribute name="id" type="xs:string"/>
</xs:complexType>
<xs:complexType final="extension restriction" name="SubmitObjectsRequest.RegistryObjectList">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="Association" type="ns2:AssociationType1"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="Classification" type="ns2:ClassificationType"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="ExtrinsicObject" type="tns:ExtrinsicObjectType"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="RegistryPackage" type="tns:RegistryPackageType"/>
</xs:sequence>
</xs:complexType>
<xs:complexType final="extension restriction" name="ExtrinsicObjectType">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="Classification" type="ns2:ClassificationType"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="Description" type="ns2:LocalizedStringType"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="ExternalIdentifier" type="ns2:ExternalIdentifierType"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="Name" type="ns2:LocalizedStringType"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="Slot" type="ns2:SlotType1"/>
</xs:sequence>
<xs:attribute name="home" type="xs:string"/>
<xs:attribute name="id" type="xs:string"/>
<xs:attribute name="isOpaque" type="xs:boolean" use="required"/>
<xs:attribute name="lid" type="xs:string"/>
<xs:attribute name="mimeType" type="xs:string"/>
<xs:attribute name="objectType" type="xs:string"/>
<xs:attribute name="status" type="xs:string"/>
</xs:complexType>
<xs:complexType final="extension restriction" name="RegistryPackageType">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="Classification" type="ns2:ClassificationType"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="ExternalIdentifier" type="ns2:ExternalIdentifierType"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="LocalizedString" type="ns2:LocalizedStringType"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="Name" type="ns2:LocalizedStringType"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="Slot" type="ns2:SlotType1"/>
</xs:sequence>
<xs:attribute name="home" type="xs:string"/>
<xs:attribute name="id" type="xs:string"/>
<xs:attribute name="lid" type="xs:string"/>
<xs:attribute name="objectType" type="xs:string"/>
<xs:attribute name="status" type="xs:string"/>
</xs:complexType>
<xs:complexType final="extension restriction" name="DocumentsRequest">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="Document" type="tns:DocumentType"/>
</xs:sequence>
<xs:attribute name="dummy" type="xs:string"/>
</xs:complexType>
<xs:complexType final="extension restriction" name="DocumentType">
<xs:sequence>
<xs:element minOccurs="0" name="data" type="xs:string"/>
</xs:sequence>
<xs:attribute name="id" type="xs:string"/>
</xs:complexType>
<xs:complexType name="PROVIDEANDREGISTERDOCUMENTSETResponse">
<xs:sequence>
<xs:element minOccurs="0" name="Registryresponse" type="tns:RegistryResponseType"/>
</xs:sequence>
</xs:complexType>
<xs:complexType final="extension restriction" name="RegistryResponseType">
<xs:sequence>
<xs:element minOccurs="0" ref="tns:RegistryErrorList"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="Slot" type="ns2:SlotType1"/>
</xs:sequence>
<xs:attribute name="requestId" type="xs:string"/>
<xs:attribute name="status" type="xs:string"/>
</xs:complexType>
<xs:complexType name="PING">
<xs:sequence/>
</xs:complexType>
<xs:complexType name="PINGResponse">
<xs:sequence>
<xs:element minOccurs="0" name="Pingresult" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="PROVIDEANDREGISTERDOCUMENTSETResponse">
<wsdl:part element="tns:PROVIDEANDREGISTERDOCUMENTSETResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="RETRIEVEDOCUMENTSET">
<wsdl:part element="tns:RETRIEVEDOCUMENTSET" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="RETRIEVEDOCUMENTSETResponse">
<wsdl:part element="tns:RETRIEVEDOCUMENTSETResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="PINGResponse">
<wsdl:part element="tns:PINGResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="PROVIDEANDREGISTERDOCUMENTSET">
<wsdl:part element="tns:PROVIDEANDREGISTERDOCUMENTSET" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="PING">
<wsdl:part element="tns:PING" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="adocumentrepository">
<wsdl:operation name="RETRIEVEDOCUMENTSET">
<wsdl:input message="tns:RETRIEVEDOCUMENTSET" name="RETRIEVEDOCUMENTSET">
</wsdl:input>
<wsdl:output message="tns:RETRIEVEDOCUMENTSETResponse" name="RETRIEVEDOCUMENTSETResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="PROVIDEANDREGISTERDOCUMENTSET">
<wsdl:input message="tns:PROVIDEANDREGISTERDOCUMENTSET" name="PROVIDEANDREGISTERDOCUMENTSET">
</wsdl:input>
<wsdl:output message="tns:PROVIDEANDREGISTERDOCUMENTSETResponse" name="PROVIDEANDREGISTERDOCUMENTSETResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="PING">
<wsdl:input message="tns:PING" name="PING">
</wsdl:input>
<wsdl:output message="tns:PINGResponse" name="PINGResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="adocumentrepository_servicesServiceSoapBinding" type="tns:adocumentrepository">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="RETRIEVEDOCUMENTSET">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="RETRIEVEDOCUMENTSET">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="RETRIEVEDOCUMENTSETResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="PROVIDEANDREGISTERDOCUMENTSET">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="PROVIDEANDREGISTERDOCUMENTSET">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="PROVIDEANDREGISTERDOCUMENTSETResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="PING">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="PING">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="PINGResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="adocumentrepository_servicesService">
<wsdl:port binding="tns:adocumentrepository_servicesServiceSoapBinding" name="adocumentrepositoryPort">
<soap:address location="http://192.168.1.42:8330/RepositorioXDS/adocumentrepository_services"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
I'm initializing the service as follows:
QName qName = new QName("RepositorioXDS", "adocumentrepository_servicesService");
URL url = new URL("file:///opt/adocumentrepository_services.xml");
AdocumentrepositoryServicesService service = new AdocumentrepositoryServicesService(url, qName);
Adocumentrepository port = service.getAdocumentrepositoryPort();
when making service.getAdocumentrepositoryPort() I am getting the following exepcion:
...
Caused by: java.security.PrivilegedActionException: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 6 counts of IllegalAnnotationExceptions
Hay dos clases que tienen el mismo nombre de tipo XML "{RepositorioXDS}RETRIEVEDOCUMENTSET". Utilice #XmlType.name y #XmlType.namespace para asignarles nombres diferentes.
this problem is related to the following location:
at simic.soap.generated.repositorio.repositorioxds.RETRIEVEDOCUMENTSET
at public simic.soap.generated.repositorio.repositorioxds.RETRIEVEDOCUMENTSET simic.soap.generated.repositorio.repositorioxds.ObjectFactory.createRETRIEVEDOCUMENTSET()
at simic.soap.generated.repositorio.repositorioxds.ObjectFactory
this problem is related to the following location:
at repositorioxds.RETRIEVEDOCUMENTSET
Hay dos clases que tienen el mismo nombre de tipo XML "{RepositorioXDS}RETRIEVEDOCUMENTSETResponse". Utilice #XmlType.name y #XmlType.namespace para asignarles nombres diferentes.
this problem is related to the following location:
at simic.soap.generated.repositorio.repositorioxds.RETRIEVEDOCUMENTSETResponse
at public simic.soap.generated.repositorio.repositorioxds.RETRIEVEDOCUMENTSETResponse simic.soap.generated.repositorio.repositorioxds.ObjectFactory.createRETRIEVEDOCUMENTSETResponse()
at simic.soap.generated.repositorio.repositorioxds.ObjectFactory
this problem is related to the following location:
at repositorioxds.RETRIEVEDOCUMENTSETResponse
Hay dos clases que tienen el mismo nombre de tipo XML "{RepositorioXDS}PROVIDEANDREGISTERDOCUMENTSET". Utilice #XmlType.name y #XmlType.namespace para asignarles nombres diferentes.
this problem is related to the following location:
at simic.soap.generated.repositorio.repositorioxds.PROVIDEANDREGISTERDOCUMENTSET
at public simic.soap.generated.repositorio.repositorioxds.PROVIDEANDREGISTERDOCUMENTSET simic.soap.generated.repositorio.repositorioxds.ObjectFactory.createPROVIDEANDREGISTERDOCUMENTSET()
at simic.soap.generated.repositorio.repositorioxds.ObjectFactory
this problem is related to the following location:
at repositorioxds.PROVIDEANDREGISTERDOCUMENTSET
Hay dos clases que tienen el mismo nombre de tipo XML "{RepositorioXDS}PROVIDEANDREGISTERDOCUMENTSETResponse". Utilice #XmlType.name y #XmlType.namespace para asignarles nombres diferentes.
this problem is related to the following location:
at simic.soap.generated.repositorio.repositorioxds.PROVIDEANDREGISTERDOCUMENTSETResponse
at public javax.xml.bind.JAXBElement simic.soap.generated.repositorio.repositorioxds.ObjectFactory.createPROVIDEANDREGISTERDOCUMENTSETResponse(simic.soap.generated.repositorio.repositorioxds.PROVIDEANDREGISTERDOCUMENTSETResponse)
at simic.soap.generated.repositorio.repositorioxds.ObjectFactory
this problem is related to the following location:
at repositorioxds.PROVIDEANDREGISTERDOCUMENTSETResponse
Hay dos clases que tienen el mismo nombre de tipo XML "{RepositorioXDS}PING". Utilice #XmlType.name y #XmlType.namespace para asignarles nombres diferentes.
this problem is related to the following location:
at simic.soap.generated.repositorio.repositorioxds.PING
at public javax.xml.bind.JAXBElement simic.soap.generated.repositorio.repositorioxds.ObjectFactory.createPING(simic.soap.generated.repositorio.repositorioxds.PING)
at simic.soap.generated.repositorio.repositorioxds.ObjectFactory
this problem is related to the following location:
at repositorioxds.PING
Hay dos clases que tienen el mismo nombre de tipo XML "{RepositorioXDS}PINGResponse". Utilice #XmlType.name y #XmlType.namespace para asignarles nombres diferentes.
this problem is related to the following location:
at simic.soap.generated.repositorio.repositorioxds.PINGResponse
at public javax.xml.bind.JAXBElement simic.soap.generated.repositorio.repositorioxds.ObjectFactory.createPINGResponse(simic.soap.generated.repositorio.repositorioxds.PINGResponse)
at simic.soap.generated.repositorio.repositorioxds.ObjectFactory
this problem is related to the following location:
at repositorioxds.PINGResponse
...
I searched #XmlType with the same name in the generated classes, but I have not found. Really I appreciate any advice
Don't fiddle with generated code unless you know what you are doing, and then you won't. Here's what I propose to solve the original problem.
If you can tweak the xjc invocation, option -p would do the trick. (If the wsimport option -p should have the same effect I don't know what went wrong. The argument must be a valid Java package name, not an OS path.)
You might define the namespace to reflect the package name, use simic.soap.generated.repositorio.repositorioxds instead of RepositorioXDS.
Or you can customize the XML Schema by adding a customization statement defining the package name:
Don't forget to add the jaxb namespace prefix definition to <xs:schema>, and the JAXB version.
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.0"
My service method inside Endpoint class looks like:
#PayloadRoot(namespace=AppExternalServicesConstant.NAMESPACE,localPart="AppPurchaseAddonRequest") #ResponsePayload public AppPurchaseAddonResponse purchaseAddon(#RequestPayload AppPurchaseAddonRequest request) throws ServiceExceptionFault {-- Business logic}
XSD looks like following:
<xs:element name="AppPurchaseAddonRequest" >
<xs:complexType>
<xs:all>
<xs:element name="requestId" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="countryCode" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="addonName" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="number" type="tns:numberType" minOccurs="1" maxOccurs="1"/>
<xs:element name="transactionId" type="tns:transactionIdType" minOccurs="1" maxOccurs="1"/>
</xs:all>
</xs:complexType>
</xs:element>
<xs:element name="AppPurchaseAddonResponse" >
<xs:complexType>
<xs:complexContent>
<xs:extension base="tns:Response">
<xs:sequence/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:complexType name="Request">
<xs:all>
<xs:element name="requestId" type="xs:string" minOccurs="1" maxOccurs="1"/>
</xs:all>
</xs:complexType>
<xs:complexType name="Response">
<xs:sequence>
<xs:element name="responseId" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="responseStatus" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
<xs:element minOccurs="0" name="responseDescription" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="ServiceExceptionFault">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" name="faultInfo" type="tns:AppPurchaseAddonFaultInfo"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:simpleType name="numberType">
<xs:restriction base="xs:string">
<xs:pattern value="[0-9]+"></xs:pattern>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="transactionIdType">
<xs:restriction base="xs:string">
<xs:maxLength value="20"></xs:maxLength>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="AppPurchaseAddonFaultInfo">
<xs:sequence>
<xs:element minOccurs="0" name="exceptionStack" type="xs:string"/>
<xs:element minOccurs="0" maxOccurs="1" name="errorCode" type="xs:string"/>
<xs:element minOccurs="0" maxOccurs="1" name="errorDescription" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
spring-ws-servlet mapping file:
<wss:annotation-driven/>
<context:component-scan base-package="com.ytlc.app"/>
<context:property-placeholder location="file:${environment.properties.file.path}" system-properties-mode="OVERRIDE" ignore-unresolvable="false"/>
<!-- General properties configuration -->
<!-- Spring Security and Validation configuration -->
<wss:interceptors>
<bean class="com.ytlc.ota.ws.services.spring.interceptors.AppPayloadValidationInterceptor">
<property name="schema" value="/WEB-INF/xsd/appservicesv1.xsd"/>
<property name="validateRequest" value="true"/>
<property name="validateResponse" value="false"/>
</bean>
</wss:interceptors>
<bean class="org.springframework.ws.soap.server.endpoint.SoapFaultAnnotationExceptionResolver" />
<!-- Web Services Orchestrated -->
<wss:dynamic-wsdl id="AppServicesV1" portTypeName="AppServicesV1Port" locationUri="/v1/appws" targetNamespace="http://www.yes.my/appservices">
<wss:xsd location="/WEB-INF/xsd/appservicesv1.xsd"/>
</wss:dynamic-wsdl>
In the generated wsdl, ServiceExceptionFault is generated as operation. Not sure what would be the issue:
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
<wsdl:operation name="ServiceException" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<soap:operation soapAction="" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
<wsdl:fault name="ServiceExceptionFault" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<soap:fault name="ServiceExceptionFault" use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="AppPurchaseAddon" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<soap:operation soapAction="" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
<wsdl:input name="AppPurchaseAddonRequest" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
</wsdl:input>
<wsdl:output name="AppPurchaseAddonResponse" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
</wsdl:output>
</wsdl:operation>
First: my english is not good
My setup: JBoss AS 7
my WebService
#WebService
#Stateless
#Local(PessoaFisicaInterfaceWS.class)
public class PessoaFisicaWS implements PessoaFisicaInterfaceWS {
#PersistenceContext
public EntityManager manager;
#Override
#WebMethod
public List<PessoaFisica> getList() {
return manager.createQuery("SELECT p FROM PessoaFisica p")
.getResultList();
}
}
my wsdl:
<wsdl:definitions name="PessoaFisicaWSService"
targetNamespace="http://pacote/">
<wsdl:types>
<xs:schema elementFormDefault="unqualified" targetNamespace="http://pacote/"
version="1.0">
<xs:element name="getList" type="tns:getList" />
<xs:element name="getListResponse" type="tns:getListResponse" />
<xs:element name="pessoaFisica" type="tns:pessoaFisica" />
<xs:complexType name="getList">
<xs:sequence />
</xs:complexType>
<xs:complexType name="getListResponse">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="return"
type="tns:pessoaFisica" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="pessoaFisica">
<xs:complexContent>
<xs:extension base="tns:pessoa">
<xs:sequence>
<xs:element minOccurs="0" name="cpf" type="xs:string" />
<xs:element minOccurs="0" name="dataRegistroGeral"
type="xs:dateTime" />
<xs:element minOccurs="0" name="escolaridade" type="tns:escolaridade" />
<xs:element minOccurs="0" name="estadoCivil" type="tns:estadoCivil" />
<xs:element minOccurs="0" name="estadoRg" type="tns:estado" />
<xs:element minOccurs="0" name="generoSexual" type="tns:sexo" />
<xs:element minOccurs="0" name="nomeConjuge" type="xs:string" />
<xs:element minOccurs="0" name="nomeMae" type="xs:string" />
<xs:element minOccurs="0" name="nomePai" type="xs:string" />
<xs:element minOccurs="0" name="numeroRegistroGeral"
type="xs:string" />
<xs:element minOccurs="0" name="profissao" type="tns:profissao" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType abstract="true" name="pessoa">
<xs:sequence>
<xs:element minOccurs="0" name="bairro" type="xs:string" />
<xs:element minOccurs="0" name="celular1" type="xs:string" />
<xs:element minOccurs="0" name="celular2" type="xs:string" />
<xs:element minOccurs="0" name="cep" type="xs:string" />
<xs:element minOccurs="0" name="cidadeEndereco" type="tns:cidade" />
<xs:element minOccurs="0" name="cidadeNascimento" type="tns:cidade" />
<xs:element minOccurs="0" name="dataNascimento" type="xs:dateTime" />
<xs:element minOccurs="0" name="email" type="xs:string" />
<xs:element minOccurs="0" name="endereco" type="xs:string" />
<xs:element minOccurs="0" name="nome" type="xs:string" />
<xs:element minOccurs="0" name="observacao" type="xs:string" />
<xs:element minOccurs="0" name="telefone1" type="xs:string" />
<xs:element minOccurs="0" name="telefone2" type="xs:string" />
<xs:element minOccurs="0" name="tipoPessoa" type="tns:tipoPessoa" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="escolaridade">
<xs:sequence />
</xs:complexType>
<xs:complexType name="estadoCivil">
<xs:sequence />
</xs:complexType>
<xs:complexType name="estado">
<xs:sequence>
<xs:element minOccurs="0" name="nomeEstado" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="sexo">
<xs:sequence />
</xs:complexType>
<xs:complexType name="profissao">
<xs:sequence />
</xs:complexType>
<xs:complexType name="cidade">
<xs:sequence>
<xs:element minOccurs="0" name="descricao" type="xs:string" />
<xs:element minOccurs="0" name="estado" type="tns:estado" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="tipoPessoa">
<xs:sequence />
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="getListResponse">
<wsdl:part element="tns:getListResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getList">
<wsdl:part element="tns:getList" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="PessoaFisicaWS">
<wsdl:operation name="getList">
<wsdl:input message="tns:getList" name="getList">
</wsdl:input>
<wsdl:output message="tns:getListResponse" name="getListResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="PessoaFisicaWSServiceSoapBinding"
type="tns:PessoaFisicaWS">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="getList">
<soap:operation soapAction="" style="document" />
<wsdl:input name="getList">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="getListResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="PessoaFisicaWSService">
<wsdl:port binding="tns:PessoaFisicaWSServiceSoapBinding"
name="PessoaFisicaWSPort">
<soap:address location="http://localhost:8080/ProcessosModulos/PessoaFisicaWS" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
but in my browser: localhost:8080/ProcessosModulos/PessoaFisicaWS?getList
<soap:Envelope>
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>No such operation: null (HTTP GET PATH_INFO:
/ProcessosModulos/PessoaFisicaWSnull)</faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
My web service doesnot find my method getList, any idea why?
thank you