on 03-10-2016 6:09 AM
Hi, new to Powerbuilder .net using 12.5.2 build 5609. Creating a WCF Client Proxy to connect to Web Service as I need to pass soap header security. When I generate the proxy I keep getting the error "Object reference not set to an instance of an object". I have tried generating another WCF Client Proxy using an amazon example and generates without any errors. Searching the web for days on end hasn't helped me. Hopeing someone can shed some light as where to look.
I am obviously doing something wrong in PowerBuilder .Net in trying to generate the Proxy as I can use the wsdl file to access and send messages using SoapUI. When I create the new WCF Client Proxy in my project I can see the services and the data classes. The error occurs when I try to generate the proxy. The soap messages I need to send are using the wsse security header which is why I have to use .Net and not our normal application of PowerBuilder 12 or 11. None of the other solutions seem to have helped in trying to work out what the issue is in the project I have created. The error message "object reference not set to an instance of an object" doesn't offer any insights so I am stuck as to what I should do. If anyone has any further suggestions please let me know, otherwise if anyone can suggest another way I can build this application not using .Net. Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Brenton;
Can you tell us ...
1) Is the WS you are trying to connect to J2EE or .Net based?
2) What version & build of PB.Net are you using?
3) Can you tell us more about the exact error(s) you are getting?
4) Have you tried accessing the WS via the free WCF Test utility first?
5) Does your WS return non-standard "C" data types?
6) Does your WS return complex nested structures?
Regards ... Chris
Thanks Bruce and Chris for your insights into what could be my issue. I however am still unable to generate the web service proxy in .net and can't work out what the issue is using the wsdl utility. The wsdl file I have is used by other developers successfully (none I assume with pb.net) and the utility did not report any error that I could identify as the cause of the error "object reference not set to an instance of an object".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anne;
Did you try testing the Web Service access using something like:
1) WCF Test - WCF Test Client (WcfTestClient.exe)
- or -
2) WIZDL Test - wizdl - Web Service GUI Test Tool - Home
Regards ... Chris
Hi Annie;
Thank you for the feedback!
For me, this rules out the WS as being the issue. Its clearly now on the PB.Net side of the equation.
The next step in my mind would be to use something like Fiddler2 (its free) to trace the interaction between the WS and WCFTest - then the interaction between PB.Net and WS. I suspect what you will find though is that there is something missing in the PB.Net to WS responses that causes it to fail. However, you should see the proper responses in the WCFTest trace interaction.
If you cannot resolve the missing/errored exchanges from PB.Net to the WS from the Fiddler2 tracing information at least you will have a documented reason why the WCF interaction fails. This information should be enough to open a support ticket with SAP technical support - attaching the Fidder2 trace as a good example of what is the exact issue.
Hopefully, someone else can jump in here and add some more suggestions / alternatives that you can try. Good luck!
Regards ... Chris
I would recommend to create Proxy class Microsoft .Net and build as .Net Assembly and using the Power Builder. Since the PowerBuilder WCF doesn't support the security header on the SOAP call.
Even in PowerBuilder 12.6 is the same case. I tried the same and failed to create WCF proxy to pass the security header in PowerBuilder.Net ...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>>I would recommend to create Proxy class Microsoft .Net and build as .Net Assembly and
>>using the Power Builder. Since the PowerBuilder WCF doesn't support the security header
>>on the SOAP call.
PowerBuilder's WCF proxy does handle security headers. That's one of the main reasons they introduced. it.
I have personally tried the same with PowerBuilder 12.6.Net using WCF and failed. Still there is is an limitation on passing security header on SOAP. Even i tried with interrupting the request and tried to add the Security header.
Do you have any sample code for the same? it helps
Thanks,
Balu
Creation and Consumption of Web Services with PowerBuilder
Hi Bruce,
I have tried this WCF in PB only support to add the AddWSEUserNameToken in the Wsse:Security header.
But if you have BinarySecurityToken or similar other token which you want to pass in the Wsse:Security , then there is no option.
If you have any method/ logic to pass the BinarySecurityToken , then please advise
Thanks
Balu
Try running the WSDL utility in the .Net SDK directly on the WSDL file. It generally gives more meaningful error messages.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anne;
The other things that might upset PB are:
1) PB works only with 2D ANSI result sets. So if your WS returns a complex set of nested structures - PB will not be able to handle this and will error.
2) PB expects only standard C++ data types. If you have unique data types embedded, the WSDL will be rejected.
Regards ... Chris
Hi Chris
The WS returns structures but not sure if they are complex. Each call sends a structure and returns a response structure. What classifies the structure as complex? Also, if I can generate the message using SoapUI and the wsdl.exe utility returns no errors, assuming PB12.net won't work, what do you suggest I use to connect to the WS? We program our other applications using PowerBuilder 11 with a Sybase database.
Thanks again
I would recommend trying a WSDLtest utility ...
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.