[JBossWS] - Re: Charset encoding problem from Linux to Windows with Disp
by cavani
There is something that I am not figuring out. Some characters just are misinterpreted... anyway... I change to SOAPMessage and set the default encoding to UTF-8 (from windows-1252 on Windows)... now it really works!
for JVM:-Dfile.encoding=UTF-8
| private Dispatch<SOAPMessage> dispatch;
|
| private MessageFactory messageFactory;
|
| /* package */ DispatchHandler(Dispatch<SOAPMessage> dispatch) throws Exception
| {
| this.dispatch = dispatch;
|
| messageFactory = MessageFactory.newInstance();
| }
|
| public SOAPMessage createRequest(String request) throws Exception
| {
| ByteArrayInputStream stream = new ByteArrayInputStream(request.getBytes());
| SOAPMessage message = messageFactory.createMessage(null, stream);
| stream.close();
| return message;
| }
|
| public String createResponse(SOAPMessage message) throws Exception
| {
| ByteArrayOutputStream stream = new ByteArrayOutputStream(1024);
| message.writeTo(stream);
| String response = stream.toString();
| stream.close();
| return response;
| }
|
| public String invoke(String request) throws Exception
| {
| try
| {
| SOAPMessage requestMessage = createRequest(request);
|
| SOAPMessage responseMessage = dispatch.invoke(requestMessage);
|
| return createResponse(responseMessage);
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4141630#4141630
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4141630
18 years
[JBossWS] - NullPointerException when processing response
by boopet
JBoss AS version: 4.0.5GA
Hi everyone,
we have created a JBossWS Client with version 2.0.1 consuming a Axis2 webservice, that is sending its responses in multipart/related format.
The client uses the UserNameToken authentification.
when the client is processing the ws answer, i get a NullPointer Exception because of some security issue:
javax.xml.ws.WebServiceException: java.lang.NullPointerException
| at org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.processHandlerFailure(HandlerChainExecutor.java:276)
| at org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.handleMessage(HandlerChainExecutor.java:155)
| at org.jboss.ws.core.jaxws.client.ClientImpl.callResponseHandlerChain(ClientImpl.java:168)
| at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:363)
| at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:243)
| at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:164)
| at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:150)
| at $Proxy24.loadEloFileUrl(Unknown Source)
| at com.giag.fo.elo.giagws.service.EloWsClientTest.testGetFileUrl(EloWsClientTest.java:110)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
| at java.lang.reflect.Method.invoke(Unknown Source)
| at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:580)
| at org.testng.internal.Invoker.invokeMethod(Invoker.java:478)
| at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:607)
| at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:874)
| at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
| at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
| at org.testng.TestRunner.runWorkers(TestRunner.java:689)
| at org.testng.TestRunner.privateRun(TestRunner.java:566)
| at org.testng.TestRunner.run(TestRunner.java:466)
| at org.testng.SuiteRunner.runTest(SuiteRunner.java:301)
| at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:296)
| at org.testng.SuiteRunner.privateRun(SuiteRunner.java:276)
| at org.testng.SuiteRunner.run(SuiteRunner.java:191)
| at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:808)
| at org.testng.TestNG.runSuitesLocally(TestNG.java:776)
| at org.testng.TestNG.run(TestNG.java:701)
| at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
| at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
| Caused by: java.lang.NullPointerException
| at org.jboss.ws.extensions.security.Util.matchNode(Util.java:188)
| at org.jboss.ws.extensions.security.Util.matchNode(Util.java:183)
| at org.jboss.ws.extensions.security.Util.findElement(Util.java:89)
| at org.jboss.ws.extensions.security.WSSecurityDispatcher.handleInbound(WSSecurityDispatcher.java:115)
| at org.jboss.ws.extensions.security.jaxws.WSSecurityHandler.handleInboundSecurity(WSSecurityHandler.java:78)
| at org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerClient.handleInbound(WSSecurityHandlerClient.java:40)
| at org.jboss.ws.core.jaxws.handler.GenericHandler.handleMessage(GenericHandler.java:55)
| at org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.handleMessage(HandlerChainExecutor.java:295)
| at org.jboss.ws.core.jaxws.handler.HandlerChainExecutor.handleMessage(HandlerChainExecutor.java:140)
|
|
can sbd give an advice?
thanks in advance!
norbert
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4141608#4141608
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4141608
18 years
[JBossWS] - Date, Time and DateTime
by gquintana
Hello,
I applied the wsconsume tool from JBoss 4.2.2 successfully on a WSDL. But when I deploy my WS implementation in JBoss, I get the following errors:
anonymous wrote : 2008-04-04 11:35:02,490 ERROR [org.jboss.ws.metadata.wsdl.xmlschema.JBossXSErrorHandler] JBossWS_datex2.eu_schema_1_0_1_048914.xsd[domain:http://www.w3.org/TR/xml...: The type 'DateTime' is atomic, so its {base type definition}, 'xs:anySimpleType', must be an atomic simple type definition or a built-in primitive datatype.
| 2008-04-04 11:35:02,493 ERROR [org.jboss.ws.metadata.wsdl.xmlschema.JBossXSErrorHandler] JBossWS_datex2.eu_schema_1_0_1_048914.xsd[domain:http://www.w3.org/TR/xml...: The type 'Time' is atomic, so its {base type definition}, 'xs:anySimpleType', must be an atomic simple type definition or a built-in primitive datatype.
| 2008-04-04 11:35:02,497 ERROR [org.jboss.ws.metadata.wsdl.xmlschema.JBossXSErrorHandler] JBossWS_datex2.eu_schema_1_0_1_048914.xsd[domain:http://www.w3.org/TR/xml...: The type 'Date' is atomic, so its {base type definition}, 'xs:anySimpleType', must be an atomic simple type definition or a built-in primitive datatype.
|
I don't understand what this error message says, but when I call the WS, I get the following error :
anonymous wrote : 2008-04-04 11:44:52,143 ERROR [org.jboss.wsf.stack.jbws.RequestHandlerImpl] Cannot close output stream
|
The Date/Time/DateTime type are defined like this:
<xs:complexType name="Date">
| <xs:simpleContent>
| <xs:extension base="xs:date" />
| </xs:simpleContent>
| </xs:complexType>
| <xs:complexType name="DateTime">
| <xs:simpleContent>
| <xs:extension base="xs:dateTime" />
| </xs:simpleContent>
| </xs:complexType>
| <xs:complexType name="Time">
| <xs:simpleContent>
| <xs:extension base="xs:time" />
| </xs:simpleContent>
| </xs:complexType>
|
In the WS impl, to instanciate the DateTime, I wrote:
DatatypeFactory.newInstance().newXMLGregorianCalendar(gregorianCalendar));
Could someone tell me where I am wrong?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4141597#4141597
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4141597
18 years
[JBossWS] - update Re: please help - web services still dont work for me
by wiggy
Yes thank you the two libraries if removed from the build work.
spent a day on the train and created a user library (rather than the jboss4.2.2 runtime library).
I dont know whos problem this is - is it JBOSS tools problem? This has cost me alot of pain/time to resolve and I think it should go into jira somewhere and change in the library builds to remove this problem.
Where should this go?
anyhow i fiddled around with the standalone client and managed to get down the following minimal set or jars (for this example)
//from /client
jbossws-spi.jar
jaxb-api.jar
jboss-jaxws.jar
jbossws-client.jar
jbossclient-all.jar
also from the /lib/endorsed directory you need
xercesImpl.jar
when i now run the client i get the result with no errors -
for any one esle with this problem you have to used wsconsume (and parse the wsdl on the server) in the /bin directory to generate the client stubs that you include in your client build
I had problems with eclipse web services explorer - in the end i'm not sure what fixed this it was either a) i created my workspace with no spaces in the path and or b) i updated the jboss ws libaries from the jbossWS downloads (i installed the jbossws-3.0.1-native-2.0.4.GA.zip) and my explorer now seems to work
is there any where where you can post a this is how you set up a project ?
| package test;
|
| import java.util.Hashtable;
|
| import javax.naming.InitialContext;
|
| import org.wstest.webservices.*;
|
| public class Test {
|
| /**
| * @param args
| */
| public static void main(String[] args) throws Exception
| {
|
| InitialContext ctx;
| // TODO Auto-generated method stub
|
|
| HelloService s = new HelloService();
| HelloServiceWS ws = s.getHelloServiceWSPort();
|
|
|
| String res = ws.sayHello();
| System.out.println ("test: returned " + res + " \n");
|
| }
|
Thanks for the help - eventually i can get back to my project!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4141489#4141489
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4141489
18 years