Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6825669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:03:36+00:00 2026-05-26T22:03:36+00:00

I have a WebService with following wsdl file: <?xml version=’1.0′ encoding=’UTF-8′?><wsdl:definitions name=BBAppWebAccessService targetNamespace=com.test xmlns:ns1=http://schemas.xmlsoap.org/soap/http

  • 0

I have a WebService with following wsdl file:

<?xml version='1.0' encoding='UTF-8'?><wsdl:definitions name="BBAppWebAccessService" targetNamespace="com.test" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="com.test" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <wsdl:types>
  <xs:schema elementFormDefault="unqualified" targetNamespace="com.test" version="1.0" xmlns:tns="com.test" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="getPOI" type="tns:getPOI" />
  <xs:element name="getPOIResponse" type="tns:getPOIResponse" />

  <xs:complexType name="poi">
  <xs:complexContent>
  <xs:extension base="tns:poiPreview">
  <xs:sequence>
  <xs:element maxOccurs="unbounded" minOccurs="0" name="images" nillable="true" type="tns:bbImage" />
  </xs:sequence>
  </xs:extension>
  </xs:complexContent>
  </xs:complexType>
    <xs:complexType name="poiPreview">

      <xs:sequence>
        <xs:element name="poiID" type="xs:int" />
        <xs:element maxOccurs="unbounded" minOccurs="0" name="thumbsnails" nillable="true" type="tns:bbImage" />
      </xs:sequence>
    </xs:complexType>
    <xs:complexType name="bbImage">
      <xs:sequence>
        <xs:element maxOccurs="unbounded" minOccurs="0" name="imageData" nillable="true" type="xs:byte" />
        <xs:element minOccurs="0" name="imageName" type="xs:string" />
        <xs:element name="imageID" type="xs:int" />
      </xs:sequence>
    </xs:complexType>
  <xs:complexType name="getPOI">
  <xs:sequence>
  <xs:element name="ID" type="xs:int" />
  </xs:sequence>
  </xs:complexType>
  <xs:complexType name="getPOIResponse">
  <xs:sequence>
  <xs:element minOccurs="0" name="return" type="tns:poi" />
  </xs:sequence>
  </xs:complexType>
  </xs:schema>
    </wsdl:types>
    <wsdl:message name="getPOI">
      <wsdl:part element="tns:getPOI" name="parameters">
      </wsdl:part>
    </wsdl:message>
    <wsdl:message name="getPOIResponse">
      <wsdl:part element="tns:getPOIResponse" name="parameters">
      </wsdl:part>
    </wsdl:message>
    <wsdl:portType name="BBAppWebAccess">
      <wsdl:operation name="getPOI">
        <wsdl:input message="tns:getPOI" name="getPOI">
      </wsdl:input>
        <wsdl:output message="tns:getPOIResponse" name="getPOIResponse">
      </wsdl:output>
      </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="BBAppWebAccessServiceSoapBinding" type="tns:BBAppWebAccess">
      <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
      <wsdl:operation name="getPOI">
        <soap:operation soapAction="" style="document" />
        <wsdl:input name="getPOI">
          <soap:body use="literal" />
        </wsdl:input>
        <wsdl:output name="getPOIResponse">
          <soap:body use="literal" />
        </wsdl:output>
      </wsdl:operation>
    </wsdl:binding>

    <wsdl:service name="BBAppWebAccessService">
      <wsdl:port binding="tns:BBAppWebAccessServiceSoapBinding" name="BBAppWebAccessPort">
        <soap:address location="http://localhost:8080/BBAppWeb/HelloWorld" />
      </wsdl:port>
    </wsdl:service>
  </wsdl:definitions>

I used the SlSvcUtil from the Windows Phone SDK to generate the proxy classes for c# SlSvcUtil.exe test.wsdl.

This is a part from the generated code:

[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
[System.ServiceModel.MessageContractAttribute(WrapperName="getPOI", WrapperNamespace="com.test", IsWrapped=true)]
public partial class getPOI {

        [System.ServiceModel.MessageBodyMemberAttribute(Order=0)]
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public int ID;

        public getPOI() {
        }

        public getPOI(int ID) {
            this.ID = ID;
        }
}

private class BBAppWebAccessClientChannel : ChannelBase<BBAppWebAccess>, BBAppWebAccess
{

    public BBAppWebAccessClientChannel(System.ServiceModel.ClientBase<BBAppWebAccess> client) : 
            base(client)
    {
    }

    public System.IAsyncResult BegingetPOI(getPOI request, System.AsyncCallback callback, object asyncState)
    {
        object[] _args = new object[1];
        _args[0] = request;
        System.IAsyncResult _result = base.BeginInvoke("getPOI", _args, callback, asyncState);
        return _result;
    }

    public getPOIResponse EndgetPOI(System.IAsyncResult result)
    {
        object[] _args = new object[0];
        getPOIResponse _result = ((getPOIResponse)(base.EndInvoke("getPOI", _args, result)));
        return _result;
    }
}

The FaultException is thrown by that getPOIResponse _result = ((getPOIResponse)(base.EndInvoke("getPOI", _args, result)));.

I call the WebService with following code:

private void Load_Initial_Data()
{
    try
    {
        BBAppWebAccessClient wac = new BBAppWebAccessClient();
        wac.getPOICompleted += new EventHandler<getPOICompletedEventArgs>(client_GetDataCompleted);
        wac.getPOIAsync(1);
    }
    catch (Exception e)
    {
        Console.WriteLine(e.StackTrace);
    }

}
void client_GetDataCompleted(object sender, getPOICompletedEventArgs e)
{
    //this.DataContext = e.Result;
    Console.WriteLine(e.Result.poiID);
}

On the server side there is following exception:

22:27:23,789 WARN  [org.apache.cxf.phase.PhaseInterceptorChain] Interceptor for {com.test}BBAppWebAccessService#{com.test}getPOI has thrown exception, unwinding now: org.apache.cxf.interceptor.Fault: Unmarshalling Error: unexpected element (uri:"com.test", local:"ID").
        at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:787) [:2.3.1-patch-01]
        at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:628) [:2.3.1-patch-01]
        at org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:133) [:2.3.1-patch-01]
        at org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:109) [:2.3.1-patch-01]
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255) [:2.3.1-patch-01]
        at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:113) [:2.3.1-patch-01]
        at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:97) [:2.3.1-patch-01]
        at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:461) [:2.3.1-patch-01]
        at org.jboss.wsf.stack.cxf.ServletControllerExt.invoke(ServletControllerExt.java:172) [:3.4.1.GA]
        at org.jboss.wsf.stack.cxf.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:57) [:3.4.1.GA]
        at org.jboss.wsf.stack.cxf.transport.ServletHelper.callRequestHandler(ServletHelper.java:156) [:3.4.1.GA]
        at org.jboss.wsf.stack.cxf.CXFNonSpringServletExt.invoke(CXFNonSpringServletExt.java:90) [:3.4.1.GA]
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179) [:2.3.1-patch-01]
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:103) [:2.3.1-patch-01]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:754) [:1.0.0.Final]
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159) [:2.3.1-patch-01]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.1.0.Final]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.1.0.Final]
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [:6.1.0.Final]
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [:6.1.0.Final]
        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) [:6.1.0.Final]
        at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285) [:1.1.0.Final]
        at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.Final]
        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) [:6.1.0.Final]
        at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) [:6.1.0.Final]
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:159) [:6.1.0.Final]
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [:6.1.0.Final]
        at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.1.0.Final]
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [:6.1.0.Final]
        at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) [:6.1.0.Final]
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [:6.1.0.Final]
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [:6.1.0.Final]
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654) [:6.1.0.Final]
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [:6.1.0.Final]
        at java.lang.Thread.run(Unknown Source) [:1.7.0]
Caused by: javax.xml.bind.UnmarshalException
 - with linked exception:
[com.sun.istack.SAXParseException2; lineNumber: 1; columnNumber: 197; unexpected element (uri:"com.test", local:"ID"). Expected elements are <{}ID>]
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(UnmarshallerImpl.java:425) [:2.2]
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:362) [:2.2]
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:339) [:2.2]
        at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:764) [:2.3.1-patch-01]
        ... 34 more
Caused by: com.sun.istack.SAXParseException2; lineNumber: 1; columnNumber: 197; unexpected element (uri:"com.test", local:"ID"). Expected elements are <{}ID>
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:642) [:2.2]
        at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:254) [:2.2]
        at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:249) [:2.2]
        at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElement(Loader.java:116) [:2.2]
        at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.childElement(Loader.java:101) [:2.2]
        at com.sun.xml.bind.v2.runtime.unmarshaller.StructureLoader.childElement(StructureLoader.java:243) [:2.2]
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:478) [:2.2]
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:459) [:2.2]
        at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleStartElement(StAXStreamConnector.java:242) [:2.2]
        at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:176) [:2.2]
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:360) [:2.2]
        ... 36 more
Caused by: javax.xml.bind.UnmarshalException: unexpected element (uri:"com.test", local:"ID"). Expected elements are <{}ID>
        ... 47 more

ClientConfig:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="BBAppWebAccessServiceSoapBinding" maxBufferSize="2147483647"
                    maxReceivedMessageSize="2147483647">
                    <security mode="None" />
                </binding>
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://localhost:8080/BBAppWeb/HelloWorld"
                binding="basicHttpBinding" bindingConfiguration="BBAppWebAccessServiceSoapBinding"
                contract="SilverlightApplication1.ServiceReference1.BBAppWebAccess"
                name="BBAppWebAccessPort" />
        </client>
    </system.serviceModel>
</configuration>

Message captured with Fiddler (Windows Phone):

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <getPOI xmlns="com.test">
            <ID>1</ID>
        </getPOI><
    /s:Body>
</s:Envelope>

Message captured with Fiddler (Axis2):

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
        <ns1:getPOI xmlns:ns1="com.test">
            <ID>1</ID>
        </ns1:getPOI>
    </soapenv:Body>
</soapenv:Envelope>

How can I fix it? The generated java code (Apache Axis2) works great.

Thanks for any advices.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:03:37+00:00Added an answer on May 26, 2026 at 10:03 pm

    I found the solution. When you are creating the WebService with Java EE you have to add all namespaces, otherwise you will get the errors above.
    After fixing the FaultException, I got a NullReferenceException, which indicates that I have to fix the response handling, too.

    Thanks a lot to @calum.

    Here is a sample implementation of the WebService, which works together with Axis2 and the SLsvcUtil tool:

    package com.test;
    
    //imports here
    
    @WebService(targetNamespace = "com.test")
    public class BBAppWebAccess {
        @WebMethod
        @WebResult(targetNamespace="com.test.poi")
        public POI getPOI(
                @WebParam(name="ID", targetNamespace="com.test.poi")
                int id) {
    
            return new POI(id);
        }
    }
    

    The new message looks like following:

    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
        <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            <getPOI xmlns="com.test">
                <ID xmlns="com.test.poi">1</ID>
            </getPOI>
        </s:Body>
    </s:Envelope>
    

    The new genereated getPOI class:

    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    [System.ServiceModel.MessageContractAttribute(WrapperName="getPOI", WrapperNamespace="com.test", IsWrapped=true)]
    public partial class getPOI {
    
        [System.ServiceModel.MessageBodyMemberAttribute(Namespace="com.test.poi", Order=0)]
        public int ID;
    
        public getPOI() {
        }
    
        public getPOI(int ID) {
            this.ID = ID;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WebService that returns XML in a SOAP response: <?xml version=1.0 encoding=utf-8
I am integrating with a webservice who have provided a wsdl file to access
I have the following xml that's sent to me from a web service. I'm
I have a webservice (asmx file) in a directory requiring form authentication When I
I have an xsd file Foo.xsd. I tried following ways to refer it in
So i have a wsdl that defines a message part like the following <wsdl:message
I have a wsdl file and i am trying to call it from a
I am trying to hit the following web service with axis2: http://www.webservicex.net/geoipservice.asmx?WSDL I have
Suppose I have the following (rather common) model Client invokes web service request ->
Currently I have webservice running on the Mono platform. When I call the service

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.