[JBossWS] - Binding exception - prefix
by alesj
I'm using JBossWS 1.0.3 with JBossAS 4.0.4.GA.
This is my JSR-181 webservice pojo:
| @Stateless
| @WebService(endpointInterface = "com.generalynx.gema.business.forecast.GBForecastSubmit")
| public class TestForecast implements GBForecastSubmit {
|
| public int submit(ForecastDocument forecastDocument) {
| System.out.println("forecastDocument = " + forecastDocument);
| return 0;
| }
|
| }
|
| --------------------
|
| @WebService
| @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
| public interface GBForecastSubmit extends Remote {
|
| @WebMethod
| int submit(ForecastDocument forecastDocument);
|
| }
|
I'm using GLUE on the client side.
This is the exception that I get when invoking WS from client:
| 14:37:52,892 DEBUG [SOAPMessage] Incomming SOAPMessage
| <soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:n3='http://forecast.business.gema.generalynx.com/jaws' xmlns:n4='http://forecast.domain.gema.generalynx.com/jaws' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
| <soap:Header/>
| <soap:Body>
| <n3:submit xmlns:n3='http://forecast.business.gema.generalynx.com/jaws' xsi:type='n3:ForecastDocument'><n3:code xsi:nil='1'/><n3:customer xsi:nil='1'/><n3:forecasts xsi:type='n4:BasicForecast'><n4:creationDate xsi:nil='1'/><n4:expectedValue xsi:type='xsd:double'>1.0</n4:expectedValue><n4:forecastDate xsi:nil='1'/><n4:variance xsi:type='xsd:double'>2.0</n4:variance></n3:forecasts><n3:receiveDate xsi:nil='1'/><n3:submitDate xsi:nil='1'/><n3:user xsi:nil='1'/></n3:submit>
| </soap:Body></soap:Envelope>
| 14:37:53,767 DEBUG [SOAPFaultException] new SOAPFaultException [code={http://schemas.xmlsoap.org/soap/envelope/}Client,string=org.jboss.w...: org.jboss.ws.jaxb.UnmarshalException: Failed to parse source: The prefix "xsi" for attribute "xsi:type" associated with an element type "n3:submit" is not bound. @ *unknown*[1,104],actor=null,detail=null]
| 14:37:53,767 ERROR [SOAPFaultExceptionHelper] SOAP request exception
| javax.xml.rpc.JAXRPCException: org.jboss.ws.binding.BindingException: org.jboss.ws.jaxb.UnmarshalException: Failed to parse source: The prefix "xsi" for attribute "xsi:type" associated with an element type "n3:submit" is not bound. @ *unknown*[1,104]
| at org.jboss.ws.soap.SOAPContentElement.getObjectValue(SOAPContentElement.java:303)
| at org.jboss.ws.binding.EndpointInvocation.transformPayloadValue(EndpointInvocation.java:233)
| at org.jboss.ws.binding.EndpointInvocation.getRequestParamValue(EndpointInvocation.java:103)
| at org.jboss.ws.binding.EndpointInvocation.getRequestPayload(EndpointInvocation.java:117)
| at org.jboss.ws.integration.jboss.ServiceEndpointInvokerEJB3.invokeServiceEndpoint(ServiceEndpointInvokerEJB3.java:115)
| at org.jboss.ws.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:115)
| at org.jboss.ws.server.ServiceEndpoint.handleRequest(ServiceEndpoint.java:209)
| at org.jboss.ws.server.ServiceEndpointManager.processSOAPRequest(ServiceEndpointManager.java:355)
| at org.jboss.ws.server.StandardEndpointServlet.doPost(StandardEndpointServlet.java:115)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
| at org.jboss.ws.server.StandardEndpointServlet.service(StandardEndpointServlet.java:76)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: org.jboss.ws.binding.BindingException: org.jboss.ws.jaxb.UnmarshalException: Failed to parse source: The prefix "xsi" for attribute "xsi:type" associated with an element type "n3:submit" is not bound. @ *unknown*[1,104]
| at org.jboss.ws.jaxrpc.encoding.JAXBDeserializer.deserialize(JAXBDeserializer.java:100)
| at org.jboss.ws.soap.SOAPContentElement.getObjectValue(SOAPContentElement.java:235)
| ... 29 more
| Caused by: org.jboss.ws.jaxb.UnmarshalException: Failed to parse source: The prefix "xsi" for attribute "xsi:type" associated with an element type "n3:submit" is not bound. @ *unknown*[1,104]
| at org.jboss.ws.jaxb.JBossXBUnmarshallerImpl.unmarshal(JBossXBUnmarshallerImpl.java:67)
| at org.jboss.ws.jaxrpc.encoding.JAXBDeserializer.deserialize(JAXBDeserializer.java:92)
| ... 30 more
| Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: The prefix "xsi" for attribute "xsi:type" associated with an element type "n3:submit" is not bound. @ *unknown*[1,104]
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:156)
| at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:126)
| at org.jboss.ws.jaxb.JBossXBUnmarshallerImpl.unmarshal(JBossXBUnmarshallerImpl.java:63)
| ... 31 more
| Caused by: org.xml.sax.SAXException: The prefix "xsi" for attribute "xsi:type" associated with an element type "n3:submit" is not bound. @ *unknown*[1,104]
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$MetaDataErrorHandler.fatalError(SaxJBossXBParser.java:332)
| at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
| at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
| at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
| at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
| at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(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)
| at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
| at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
| at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:152)
| ... 33 more
| 14:37:53,798 DEBUG [SOAPMessage] Outgoing SOAPMessage
| <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
| <env:Header/>
| <env:Body>
| <env:Fault>
| <faultcode>env:Client</faultcode>
| <faultstring>org.jboss.ws.binding.BindingException: org.jboss.ws.jaxb.UnmarshalException: Failed to parse source: The prefix "xsi" for attribute "xsi:type" associated with an element type "n3:submit" is not bound. @ *unknown*[1,104]</faultstring>
| </env:Fault></env:Body></env:Envelope>
|
This is generated wsdl
| <definitions name='GBForecastSubmitService' targetNamespace='http://forecast.business.gema.generalynx.com/jaws' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:ns1='http://forecast.domain.gema.generalynx.com/jaws' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://forecast.business.gema.generalynx.com/jaws' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
| <types>
| <schema elementFormDefault='qualified' targetNamespace='http://forecast.domain.gema.generalynx.com/jaws' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:ns1='http://forecast.business.gema.generalynx.com/jaws' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://forecast.domain.gema.generalynx.com/jaws' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
| <import namespace='http://forecast.business.gema.generalynx.com/jaws'/>
| <complexType name='BasicForecast'>
| <sequence>
| <element name='creationDate' nillable='true' type='dateTime'/>
| <element name='expectedValue' type='double'/>
| <element name='forecastDate' nillable='true' type='dateTime'/>
|
| <element name='variance' type='double'/>
| </sequence>
| </complexType>
| </schema>
| <schema elementFormDefault='qualified' targetNamespace='http://forecast.business.gema.generalynx.com/jaws' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:ns2='http://forecast.domain.gema.generalynx.com/jaws' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://forecast.business.gema.generalynx.com/jaws' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
| <import namespace='http://forecast.domain.gema.generalynx.com/jaws'/>
| <complexType name='ForecastDocument'>
| <sequence>
| <element name='code' nillable='true' type='string'/>
|
| <element name='customer' nillable='true' type='string'/>
| <element maxOccurs='unbounded' minOccurs='0' name='forecasts' nillable='true' type='ns2:BasicForecast'/>
| <element name='receiveDate' nillable='true' type='dateTime'/>
| <element name='submitDate' nillable='true' type='dateTime'/>
| <element name='user' nillable='true' type='string'/>
| </sequence>
| </complexType>
| </schema>
| </types>
|
| <message name='GBForecastSubmit_submitResponse'>
| <part name='result' type='xsd:int'/>
| </message>
| <message name='GBForecastSubmit_submit'>
| <part name='ForecastDocument_1' type='tns:ForecastDocument'/>
| </message>
| <portType name='GBForecastSubmit'>
| <operation name='submit' parameterOrder='ForecastDocument_1'>
| <input message='tns:GBForecastSubmit_submit'/>
|
| <output message='tns:GBForecastSubmit_submitResponse'/>
| </operation>
| </portType>
| <binding name='GBForecastSubmitBinding' type='tns:GBForecastSubmit'>
| <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
| <operation name='submit'>
| <soap:operation soapAction=''/>
| <input>
| <soap:body namespace='http://forecast.business.gema.generalynx.com/jaws' use='literal'/>
|
| </input>
| <output>
| <soap:body namespace='http://forecast.business.gema.generalynx.com/jaws' use='literal'/>
| </output>
| </operation>
| </binding>
| <service name='GBForecastSubmitService'>
| <port binding='tns:GBForecastSubmitBinding' name='GBForecastSubmitPort'>
| <soap:address location='http://Morozevic:8080/BusinessImplementationEJB/TestForecast'/>
|
| </port>
| </service>
| </definitions>
|
Is this a problem of GLUE being to old?
This is the mapping file that I get generated from wsdl by GLUE:
| <?xml version='1.0' encoding='UTF-8'?>
| <!--generated by GLUE Standard 4.1.2 (wsdl2java) on Mon Oct 23 14:36:56 CEST 2006-->
| <map:mappings xmlns:map='http://www.themindelectric.com/schema/' xmlns:n1='http://forecast.domain.gema.generalynx.com/jaws'>
| <xsd:schema xmlns:xsd='http://www.w3.org/2001/XMLSchema' elementFormDefault='qualified' targetNamespace='http://forecast.business.gema.generalynx.com/jaws'>
| <xsd:import namespace='http://forecast.domain.gema.generalynx.com/jaws'/>
| <xsd:complexType name='ForecastDocument' map:class='com.generalynx.gema.domain.forecast.ForecastDocument'>
| <xsd:sequence>
| <xsd:element name='code' nillable='true' map:field='code' type='xsd:string'/>
| <xsd:element name='customer' nillable='true' map:field='customer' type='xsd:string'/>
| <xsd:element name='forecasts' minOccurs='0' maxOccurs='unbounded' nillable='true' map:field='forecasts' type='n1:BasicForecast'/>
| <xsd:element name='receiveDate' nillable='true' map:field='receiveDate' type='xsd:dateTime'/>
| <xsd:element name='submitDate' nillable='true' map:field='submitDate' type='xsd:dateTime'/>
| <xsd:element name='user' nillable='true' map:field='user' type='xsd:string'/>
| </xsd:sequence>
| </xsd:complexType>
| </xsd:schema>
| <xsd:schema xmlns:xsd='http://www.w3.org/2001/XMLSchema' elementFormDefault='qualified' targetNamespace='http://forecast.domain.gema.generalynx.com/jaws'>
| <xsd:complexType name='BasicForecast' map:class='com.generalynx.gema.domain.forecast.BasicForecast'>
| <xsd:sequence>
| <xsd:element name='creationDate' nillable='true' map:field='creationDate' type='xsd:dateTime'/>
| <xsd:element name='expectedValue' map:field='expectedValue' type='xsd:double'/>
| <xsd:element name='forecastDate' nillable='true' map:field='forecastDate' type='xsd:dateTime'/>
| <xsd:element name='variance' map:field='variance' type='xsd:double'/>
| </xsd:sequence>
| </xsd:complexType>
| </xsd:schema>
| </map:mappings>
Rgds, Ales
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3980045#3980045
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3980045
18 years, 4 months
[JBossWS] - secured EJB webservice endpoint
by vachacz
Hi
I'm looking forward to expose secured EJB webservice endpoint. My EJB is protected with JAAS security domain (DatabaseLoginModule with ClientLoginModule works fine). I'm able to deploy EJB as a webservice using annotations. All works really well. When i call webservice within a client code i can call EJB WebMethods that has @PermitAll annotation. My problem occurs with methods that are allowed only for JAAS authorized users (@RolesAllowed({...})). When i call such a method i recive
| Caused by: java.lang.SecurityException: Insufficient permissions, principal=null, requiredRoles=[showKlient], principalRoles=[]
|
it's normal behaviour becouse my client isn't authorized with JAAS. I wonder how to do JAAS login via SOAP. It would be great to do it with a pySOAP (python) or SOAPLite (perl) clients
I read a lot on a jBoss forum and i didn't find anything
thx in advance
Lucas
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3979997#3979997
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3979997
18 years, 4 months
[JBossWS] - getMessageContext -> NOT IMPLEMENTED
by ppc
Hi
im using a stateless ejb3 with jsr181 as endpoint running on jboss-4.0.4.GA with EJB3-RC9FD
the method is trying to retreiving a soap attachment with the follwing code:
| @WebService( ...)
| @SOAPBinding(style = SOAPBinding.Style.RPC)
| @Stateless
| public class Broker {
|
| @Resource
| SessionContext ctx;
|
|
| ....
| ....
|
| private DataHandler getDataHanler() throws SOAPException {
|
| SOAPMessageContext msgContext = (SOAPMessageContext)ctx.getMessageContext();
| SOAPMessage soapMessage = msgContext.getMessage();
|
| Iterator attachments = soapMessage.getAttachments();
| if (attachments.hasNext())
| {
| AttachmentPart ap = (AttachmentPart)attachments.next();
| dh=ap.getDataHandler();
|
| }
| return dh;
|
| }
|
but jboss is throwing a NOT IMPLEMENTD...
| Caused by: java.lang.RuntimeException: NOT IMPLEMENTED
| at org.jboss.ejb3.BaseSessionContext.getMessageContext(BaseSessionContext.java:331)
| at net.nxt.core.Broker.getDataHanler(Broker.java:90)
|
does anybody succeed to retreive an attachement for a stateless bean ?
ppc
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3979912#3979912
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3979912
18 years, 4 months
[JBossWS] - SOAP Address in wsdl file
by MmarcoM
hi all,
is there any way to specify the proper URL for an EJB3 deployed as a webservice?
in my wsdl, URL is *ALWAYS* at port 8080, while my jboss is runnign at port 9080.....
here's wsdl of EJB3 deployed as webservice
| <definitions name="WSFacade" targetNamespace="http://org.jboss.ws/ejb3ws">
| ?
| <types>
| ?
| <schema elementFormDefault="qualified" targetNamespace="http://core.j2me.mm.com/jaws">
| <import namespace="http://org.jboss.ws/ejb3ws"/>
| ?
| <complexType name="Agency">
| ?
| <sequence>
| <element name="emailAddress" nillable="true" type="string"/>
| <element name="id" type="int"/>
| <element name="jobHunter" nillable="true" type="string"/>
| <element name="name" nillable="true" type="string"/>
| <element name="phoneNumber" nillable="true" type="string"/>
| <element name="site" nillable="true" type="string"/>
| </sequence>
| </complexType>
| </schema>
| ?
| <schema elementFormDefault="qualified" targetNamespace="http://org.jboss.ws/ejb3ws">
| <import namespace="http://core.j2me.mm.com/jaws"/>
| ?
| <complexType name="testWebServiceMethod">
| ?
| <sequence>
| <element maxOccurs="unbounded" minOccurs="0" name="Agency_1" nillable="true" type="ns2:Agency"/>
| </sequence>
| </complexType>
| ?
| <complexType name="testWebServiceMethodResponse">
| ?
| <sequence>
| <element maxOccurs="unbounded" minOccurs="0" name="result" nillable="true" type="ns2:Agency"/>
| </sequence>
| </complexType>
| <element name="testWebServiceMethod" type="tns:testWebServiceMethod"/>
| <element name="testWebServiceMethodResponse" type="tns:testWebServiceMethodResponse"/>
| </schema>
| </types>
| ?
| <message name="WSRemoteSEI_testWebServiceMethodResponse">
| <part element="tns:testWebServiceMethodResponse" name="result"/>
| </message>
| ?
| <message name="WSRemoteSEI_testWebServiceMethod">
| <part element="tns:testWebServiceMethod" name="parameters"/>
| </message>
| ?
| <portType name="WSRemoteSEI">
| ?
| <operation name="testWebServiceMethod">
| <input message="tns:WSRemoteSEI_testWebServiceMethod"/>
| <output message="tns:WSRemoteSEI_testWebServiceMethodResponse"/>
| </operation>
| </portType>
| ?
| <binding name="WSRemoteSEIBinding" type="tns:WSRemoteSEI">
| <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
| ?
| <operation name="testWebServiceMethod">
| <soap:operation soapAction=""/>
| ?
| <input>
| <soap:body use="literal"/>
| </input>
| ?
| <output>
| <soap:body use="literal"/>
| </output>
| </operation>
| </binding>
| ?
| <service name="WSFacade">
| ?
| <port binding="tns:WSRemoteSEIBinding" name="WSRemoteSEIPort">
| <soap:address location="http://WorldCorp:8080/ejbJ2me-app-1/TestFacade"/>
| </port>
| </service>
| </definitions>
|
is there any way to customize the soap address?
thanks in advance and regarsd
Marco
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3979901#3979901
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3979901
18 years, 4 months
[JBossWS] - Re: Web Service and Arrays
by HowardU
The problem was actually discovered once I got the log4j to show the following message: [java] 23:30:38,015 WARN [JSR109ClientMetaDataBuilder] Cannot obtain the SEI mapping for: {http://gov.osera.bpel}Finaince_LoBService_1
This led me to figure out how to use all of the @Webservice @Webmethod and @Webparam annotations to match up the wsdl names with the generated java code names as follows:
@WebService(name = "ContractorInvoice_ContractorInvoice", targetNamespace = "http://gov.osera.bpel", serviceName = "Finaince_LoBService")
@SOAPBinding(style = SOAPBinding.Style.RPC)
public class ContractorInvoiceService
{
@WebMethod(operationName="Invoices")
public void invoices(
@WebParam(name="Invoices") InvoiceType[] invoices,
@WebParam(name="correlationId") java.lang.String correlationId) throws java.rmi.RemoteException
...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3979867#3979867
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3979867
18 years, 4 months