This article about SOAP(client) is actually platform-specific. But programming in C# is very popular and is a big part of .NET I feel it's important to learn/get a hang of C# and its way of handling the SOAP-service. It's been a long time since the last time I used Visual Studio, but I remember it as being a very nice experience. I used to do some programming in Visual C++ and the DirectX interface. I think it was DirectX 8..or 9..using Direct3D/DirectSound and so on...but this is a digression...The point of this article is to connect to a server using the SOAP-protocol via a WSDL. I think using the WSDL is the more simple way, and it's easy to use. Must admit that this is the first time I appoach C#. I went through a "basics"-tutorial and found out that the syntax and language was quite like C, but also a little bit like Java(even though I do not have a lot of experience programming Java).

This was a challenge I must admit. There wasn't alot of API's to find that handles SOAP-requests. I ended up with one that I tried and failed and tried again. gSOAP. About gSOAP you can find here: www.genivia.com. I downloaded the source from sourceforge which is an opensource version. (I don't recommend installng from your OS-distributor. I yhink there were some source-files that were missing that you need). See here: https://sourceforge.net/projects/gsoap2/. Depending on your system, there are some options whn configuring, making and installing gSOAP. My system is Linux. I had to make sure I had Automake, Bison, Flex openssl, and zlib(everything). The INSTALL.txt file contains all information about how-to install for your specific system.

Nå har det vært lenge siden jeg har skrevet noe her i det hele tatt. Så lenge siden at jeg vet nesten ikek hva det er jeg driver med.crying. Da får man lyst til å gråte litt... ehhmmm. Er nok ikke rette til det men men..her er situasjonen:

I don't do much programming anymore but sometimes it's nice to see how things work in the environment I work. So....my worksituation is that we use a remote WMS (warehouse management system). And there are a bunch of clients that need to communicate with that system. Most people/clients (if they are not too cheap) would want to make an integration to that system. The server I believe is a windows-server that uses a SOAP-server that clients can connect to. Old interface.... but it works. The programming language(script-) i wanted to test this on, is PHP. This is the scripting language I remember best. I'm not going to go into the details of this because I do not know the details. I just found something that works.

Klarte endelig å løse problemet. Det er tydelig det er mange "quirks" i PHP man må lære seg før man finner noe som fungerer. Har saumfart internett/google for å prøve å finne en løsning på hvordan jeg skal kunne erstatte tegnet "\n"(newline, linefeed, carriage return)...ja ...man kan kalle det så mangt. Poenget er uansett det at jeg var ute etter det å erstatte dette tegnet med strengen "<br />". Så da skjønner man jo hva jeg driver med. Strengen jeg skulle jobbe med kom fra system("cat /proc/cpuinfo"). som da inneholder mange newline-tegn. Det er forholdsvis ganske mye info ang cpu'er uansett hvor gammel den er. Og har man flere kjerner så blir det enda mer dill-dall-info som er ganske repeterendes. Iallefall...

Subcategories

Småprat om alt innen programmering

Artikler rundt om og men datamaskiner.