[JBossWS] - Problem with SAAJ Client for Webservice that receives attach
by RomeuFigueira
Hi there, I've implemented a webservice (JSR-109) that receives two parameters and one attachment. It's working fine, testing with soapui 1.6 beta2 showed that my service could receive and store attachments without a problem.
Now I wanted to create a SAAJ client to make contact with such webservice. I have previous experience developing clients without the attachment part, but in this one I'm having problems.
I've based my client on this one http://labs.jboss.com/portal/jbossws/user-guide/en/html/attachments.html
but when interacting with the webservice, I keep on getting this message:
<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
| <env:Header/>
| <env:Body>
| <env:Fault xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
| <faultcode>env:Client</faultcode>
| <faultstring>multipart/related type specified a root type other than the one that was found.</faultstring>
| </env:Fault>
| </env:Body>
| </env:Envelope>
This is my request message via soapUI
| ------=_Part_1_20574010.1162549201841
| Content-Type: text/xml; charset=UTF-8
| Content-Transfer-Encoding: 8bit
| Content-ID: <rootpart(a)soapui.org>
|
| <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:.mediation">
| <soapenv:Header/>
| <soapenv:Body>
| <urn:depositAttach>
| <id_lote>5</id_lote>
| <file_name>text</file_name>
| </urn:depositAttach>
| </soapenv:Body>
| </soapenv:Envelope>
| ------=_Part_1_20574010.1162549201841
| Content-Type: text/plain; charset=us-ascii
| Content-Transfer-Encoding: 7bit
| Content-ID: <mimepart=1788743063992(a)soapui.org>
|
| Text message here
| ------=_Part_1_20574010.1162549201841--
|
And this is my message via my SAAJ client
| ------=_Part_0_12285029.1162549416820
| Content-Type: text/xml; charset=utf-8
|
| <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:mediation">
| <SOAP-ENV:Header/>
| <SOAP-ENV:Body>
| <urn:depositAttach>
| <id_lote>1</id_lote>
| <file_name>text</file_name>
| </urn:depositAttach>
| </SOAP-ENV:Body>
| </SOAP-ENV:Envelope>
| ------=_Part_0_12285029.1162549416820
| Content-Type: multipart/mixed;
| boundary="----=_Part_0_28470003.1162549416710"
| Content-ID: <mimepart=1876756521231(a)example.com>
|
| ------=_Part_0_28470003.1162549416710
| Content-Type: text/plain
|
| Text message here
| ------=_Part_0_28470003.1162549416710--
|
| ------=_Part_0_12285029.1162549416820--
|
Additionaly, here is the header of the SOAP transmission from soapUI
| SOAPAction: ""
| Content-Type: multipart/related; type="text/xml";
| start="<rootpart(a)soapui.org>";
| boundary="----=_Part_1_20574010.1162549201841
| MIME-Version: 1.0
| User-Agent: Jakarta Commons-HttpClient/3.0.1
| Host: localhost:8080
| Content-Length: 697
|
Now, here's my problem, I know that the messages are correct, as you can also see, but there must be something wrong with my definiton of attachment. I cannot reproduce the part highlighted in the soapui message, and think that is where my problem lays. Somewere in server process, when the message goes through my client, it can't split the message into two, the Body Part and the Attachment part, and complains when it finds a "text/plain" instead of "text/xml".
Can you help me here?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3982915#3982915
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3982915
19Â years, 6Â months
[JNDI/Naming/Network] - Re: using Tomcat to serve EJB requests
by cjc
Hi,
I have the same configuration. I did copy the lib's from Jboss to webapps/"something"/WEB-INF/lib
| jbossall-client.jar
| jboss-aop-jdk50-client.jar
| jboss-aspect-jdk50-client.jar
| jboss-aspect-library-jdk50.jar
| jboss-ejb3-client.jar
| jboss-ejb3x.jar
| ejb3-persistence.jar
| hibernate-client.jar
| jmx-client.jar
|
|
| put a jndi.properties file in classpath (webapps/"something"/WEB-INF/classes)
|
|
| | java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
| |
| | java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
| |
| | java.naming.provider.url=jnp://"otherMachine":1099
| |
|
| and importend add the starting parameter to Tomcat -nonaming
|
| EJB 3.0 lookup
| InitialContext itx = new InitialContext();
| | ModulDataManager modulDataManager = (ModulDataManager) itx.lookup("ModulDataManagerBean/remote");
|
| I think this is very dirty but works easy. I woud be happy to have a nicer way! Mainly the "-nonaming" i did't like!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3982909#3982909
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3982909
19Â years, 6Â months
[JBoss AOP] - Re: Aspect scope and construction pointcuts
by chrismeadows
Hi there,
I've pulled and built the 1_5_0 branch, but still get the same problem. I've been having a look at the source and believe the casue of the problem is in org.jboss.aop.advice.AbstractAdvice#resolveAdvice(Invocation)
The code I see states
| ...
| if (invocation instanceof ConstructorInvocation)
| {
| if (constructorAdvice == null)
| {
| throw new IllegalStateException("Unable to resolve ConstructorInvocation advice " + getName());
| }
| return constructorAdvice;
| }
| if (invocation instanceof ConstructionInvocation)
| {
| if (constructorAdvice == null)
| {
| throw new IllegalStateException("Unable to resolve ConstructionInvocation advice " + getName());
| }
| return constructorAdvice;
| }
|
| ...
|
This looks like copy-and-pastification. Should it be...
| ...
| if (invocation instanceof ConstructorInvocation)
| {
| if (constructorAdvice == null)
| {
| throw new IllegalStateException("Unable to resolve ConstructorInvocation advice " + getName());
| }
| return constructorAdvice;
| }
| if (invocation instanceof ConstructionInvocation)
| {
| if (constructionAdvice == null) // construction, not constructor
| {
| throw new IllegalStateException("Unable to resolve ConstructionInvocation advice " + getName());
| }
| return constructionAdvice; // construction, not constructor
| }
|
| ...
|
is this the fix from yesterday? If so, I'm not seeing it in the pull of the 1_5_0 branch :(
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3982906#3982906
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3982906
19Â years, 6Â months