473,387 Members | 1,486 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

I just want to make a SOAP request!

HaLo2FrEeEk
404 256MB
Why is it so difficult?!?

Ok, Bungie has created an API for their new game, Halo Reach. The API allows you to access details stats and information about the game. There are two endpoints, JSON and SOAP. I figured that since SOAP was already XML that it would be easier to get that file than to translate the JSON into usable data. I think I was wrong.

I cannot figure out how to make a SOAP request using C#. When I just use a regular old HttpWebRequest/HttpWebResponse, I get an error "400 (Bad Request)."

Can someone please help me figure this out, or tell me if it would just be easier to use JSON.
Oct 11 '10 #1
4 6827
Curtis Rutland
3,256 Expert 2GB
Right click on References, and click Add Service Reference:



Put in the address to the service, click Go, and name the service once it's found.

That will create service client code in your project. Depending on what type of service it is, the code will vary a bit.

If you post the address to the SOAP service, I can give some more details.
Oct 12 '10 #2
HaLo2FrEeEk
404 256MB
I did that, but all of the guides that I found online told me to put in:

http://Server/nwind2/soap?wsdl

I've never used SOAP before so I didn't know what to do.

I just put in the service reference for the SOAP service and it came up with all of the methods available. Here is the address:

http://www.bungie.net/api/reach/reachapisoap.svc

You won't be able to actually make a calls without an API key though, and you have to pay for one of those.

Unfortunately I'm stll having a problem. In the service reference it lists all of the available methods, and I named the reference "ReachAPI", but when I do ReachAPI., it doesn't have any of the methods listed, I can't figure out how to access them.
Oct 12 '10 #3
Curtis Rutland
3,256 Expert 2GB
These screenshots should give you a slightly more detailed idea of what's going on:





Note what I called the service. You can call it anything you'd like, but that becomes the namespace (that I highlighted in the second image).

To use the service, you have to create a client. this service is called ReachApiSoap, so the client is ReachApiSoapClient. Then you use the client to make method calls.

You can also set it up to generate Asynchronous methods, which execute on a separate thread, and call a method back when they're done.

Hope this helps.
Oct 12 '10 #4
1.You will need a new instance of Visual Studio 2010 or Visual Web Developer running.
2.Create a new project using the Web Services Template.
3.In solution explorer, you could choose to rename the IService.cs and the Service.cs files, and also rename the Service and IService classes. Create the SOAP methods. I believe you know how to do that. In the Service.svc file, configure or change the names of the Service attribute to match the name of the Service class and also alter the name of code_behind attribute to match the name of the Service.cs file.
4.In the Web.config file, configure the endpoint to use wsHttp.
5.On the File menu, click save all.
6.Right click the Service.svc file in Solution Explorer and click View in Browser to view the SOAP Web Service.
7.A piece of class code would show you how to create the proxy. Record the http://localhost:portNumber/Namespace/Service.sc information.
8.Now open your WPF project in a new instance of Visual Studio or Express Edition.
9.Right click the project in Solution Explorer and click Add Service Reference.
10. Enter the address you recorded and enter the namespace name in the Namespace field and click OK.
11.When your SOAP Web Service appears in the Dialog box, highlight it and click OK. The Web Service should be added to your WPF Project.
12.Append a Using directive as your "WPF project name.Your Soap Web Service";
13.Create the proxy and begin calling the SOAP functions.
I hope this suffices.
Oct 14 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: The Grand Admiral | last post by:
Question. I have a wsdl soap request structure as follows: <soap:Envelope xmlns:xsi="..." xmlns:xsd="..." xmlns:soap="..."> <soap:Header>... </soap:Header> <soap:Body> <SaveItem xmlns="...">...
0
by: ramas | last post by:
Hi, I am new to PHP scripting and i am trying to connect to a soap server (as mentioned below) using the SOAP extension comesup with PHP. Now my requirement is to add my HTTP header fields along...
0
by: Amar | last post by:
I am recieving the "The root element is missing" error from my soap extension while attempting to validate an incoming SOAP message request. I suspect the problem resides in the ChainStream method...
3
by: Sydney | last post by:
Hi, I am trying to construct a WSE 2.0 security SOAP request in VBScript on an HTML page to send off to a webservice. I think I've almost got it but I'm having an issue generating the nonce...
2
by: urs | last post by:
Hello, I want to intercept every request made to a web service in order to be able to display the actual SOAP request in a WebBrowser control (for documentation purposes in a test tool). I know how...
3
by: Joshua Morgan | last post by:
Hey all, I want to write my own SOAP server without using any libraries such as PEAR::SOAP or nusoap. My question is how do I get the soap request from the POST body? It doesn't appear...
0
by: Florian Laws | last post by:
Hello, to work around an interoperability problem with the PHP5 SOAP extension, I'd like to modify the generate XML SOAP request. (as described in...
1
by: Jens | last post by:
Hello, I have some code that calls an external webservice. To debug I want to get the Soap message before it's send to the webservice. Is there a way to get the soap message? Some example of...
0
by: Ivan S | last post by:
Hi there. Basically, I have function "SomeFunction" that takes 2 arguments "Arg1" and "Arg2" that are string types and returns "RetVal" that is integer. Web url is "http://webservice.php". I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.