[JBossWS] - Re: Document Literal style
by zeeshan.javeed
Hi,
Thx for your reply. Acutally, my problem is bit more wierd. I have to modify the current webservices developed using old version of Jbossws. Now I have complied the server side with new jbossws 2.0.2 and new wsdl file is generated and deployed. The new client created against this wsdl file using wsconsume works very fine but the old client, created with pervious version are not working.
After my investigation, I am of the view that problme is due to mapping and document literal style. Earlier code generated a mapping.xml file and now this time no mapping.xml file is generated. So that is the main reason I asked how we can use the Document Literal in a right way.
Secondly, my wsdl file is always generated and deployed in Jboss , default/data folder. I wanted to deploy it some other location and with different port , for example 8080 instead of 80, so that i can debug the out put using TCP MON. Can Any body, help me how to
1) use Document Literal ( so that it generates mapping.xml file )
2) change locatoin and port of wsdl file.
Thanks & Regards,
Zeeshan
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4111637#4111637
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4111637
17 years, 1 month
[JBossWS] - Weird behaviour of JbossWS with DII
by paoletto
i have this endpoint, which reflects a Session bean implementation
| package bps.ejb;
|
| import javax.jws.WebService;
|
| @WebService(targetNamespace = "http://bps.ejb",
| name = "BpsFrontendEndpointInterface")
|
| public interface BpsFrontendEndpointInterface {
| public String hello();
| public String hello2(String foo, String bar, String pippo);
| public void insertProcess(int queue, int prio, String data, int ptype,
| String callbackMode,String callback,String callbackParm, String returnAddress);
| public void reactivateProcess(int pid);
| public void holdProcess(int pid);
| public void deleteProcess(int pid);
| public String testEntity();
| }
|
where's the weird part? well, if i change both in the endpoind and in the slsb the method "hello2()" to return a String[], when i invoke it with a configured DII client (copied straight off the examples), i get a "org.jboss.ws.WSException: Cannot obtain java type mapping for: {http://jaxb.dev.java.net/array}stringArray". Ok.
BUT it happens too even for method String hello(), which by the way worked before (eg. when hello2 was String instead of String[]) and same for insertProcess() and others.
So actually adding a String[] method to this endpoind (and to the implementation) cause DII to fail for every other methods.
Can someone explain me this point?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4111468#4111468
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4111468
17 years, 1 month
[JBossWS] - Re: change HTTP status code in a WS fault
by derek.adams
The only way I could figure out to do it was to change the JBossWS source code in RequestHandlerImpl. It's a small change, but since it violates the "must return a 500 on fault" rule, I doubt it's going to get added as a perm fix. I wish there was a way to make flex work with the 500 error code :-( ... The fix is for the 2.0.0.GA source under org.jboss.wsf.stack.jbws.RequestHandlerImpl at line 287.. change it to..
if (httpResponse != null && code == null && isFault)
| {
| httpResponse.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
| }
|
This way.. if the response code is set in a handler, it overrides the 500 response code. The only thing left to do is register a handler on the web service via the @HandlerChain annotation. The handler should have the following method...
/*
| * (non-Javadoc)
| *
| * @see javax.xml.ws.handler.Handler#close(javax.xml.ws.handler.MessageContext)
| */
| public void close(MessageContext context) {
| context.put(MessageContextJAXWS.HTTP_RESPONSE_CODE, new Integer(200));
| context.setScope(MessageContextJAXWS.HTTP_RESPONSE_CODE, Scope.APPLICATION);
| }
|
And.. voila.. it should work with Flex. Note that this will change all 500 responses from web services to 200s. A better approach might be to add code to the handler to check if it's Flex requesting the data (via the ServletRequst passed in the message context) and only change the code in that instance.
Hope that helps,
Derek
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4111337#4111337
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4111337
17 years, 1 month
[JBossWS] - Re: UsernameToken authentication using JBossWS
by alessio.soldano@jboss.com
"leandroal" wrote : Do you say something like this:
|
| Map<String, Object> requestContext = ((BindingProvider)serviceSoap).getRequestContext();
| requestContext.put(BindingProvider.USERNAME_PROPERTY, "OULU");
| requestContext.put(BindingProvider.PASSWORD_PROPERTY, "810420_A");
|
| If yes, I did and it doesn't work.
|
| When I run wsconsumer against the wsdl, it generated the UsernameToken java class and I can instantiate it:
|
| UsernameToken usernameToken = new UsernameToken();
| usernameToken.setUsername("xxx");
| usernameToken.setPassword("yyyy");
|
| But how to add this object into the SOAP Header?
|
| Thanks,
| Leandro.
|
|
OK, please post here the wsdl of the service you would like to call. It seems that the endpoint you're hitting is not using the standard ws-security + username token. It's using a custom soap header named the same way (but with different namespace, yesterday I didn't noticed it, sorry).
If you can't change the service contract (using the standard security would of course be better), you issue becomes "how do I set up a custom soap header?". Setting a soap header should be quite straightforward, however it seems you have an issue with the tools, since wsconsume is not correctly creating the parameter corresponding to the header. Please post here the wsdl so that we can try to understand why.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4111121#4111121
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4111121
17 years, 1 month
[JBossWS] - Re: String[] and jax-ws
by shoeb1981
I've not worked much with web service. Here is my speculation only.
When you use web services, your use XML to communicate with the client. Not all the java in-build types are provided by xml schema (be a DTD or XSD). In this case, you are returning Stringp[] array. There probably be no corresponding data type in the XSD for that. Or the tool that you have used to generate the WSDL might have translated the String[] to net.java.dev.jaxb.array.StringArray. So at client you are getting StringArray class.
If you don't want StringArray to be returned, you might need to change the WSDL to change the return type definition mentioned in the schema.
Hope that helps.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4111116#4111116
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4111116
17 years, 1 month